agentic-scaffolding
Skill9 starsChanged 4 months agoMITView on GitHub
Use when designing, auditing, or evolving a repository and its engineering workflow for coding agents — AGENTS.md or CLAUDE.md, repo-local skills, agent-readable documentation, plans and memory, scripts and guardrails, isolated workspaces, sandboxing, observability, verification, evals, or issue-driven orchestration.
In this repository33 other files it gives its agents.
- AGENTS.mdAGENTS.md
- annas-archive-ebooksSkill
- ansi-artSkill
- clarifySkill
- conjecture-cascadeSkill
- crystallizeSkill
- dianalokadaSkill
- duris-game-knowledgeSkill
- duris-group-combatSkill
- ebook-extractorSkill
- failure-modesSkill
- gpt-pro-loopSkill
- graph-researcherSkill
- improve-codebaseSkill
- jevSkill
- julian-writingSkill
- kalshi-prediction-marketSkill
- lemmaSkill
- medium-paywall-bypassSkill
- ml-learning-methodsSkill
- name-reviewSkill
- no-process-pornSkill
- pm-deep-analysisSkill
- pm-market-analysisSkill
- pm-research-methodologiesSkill
- pm-situation-framingSkill
- prediction-drillSkill
- probe-driven-designSkill
- refine-testsSkill
- remove-ai-sinsSkill
- show-usageSkill
- writing-claude-skillsSkill
- x-undocumented-apiSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 15 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈15
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 25
Start from friction: Add scaffolding for observed or credible failure modes, not fashion.
- Distinctive: line 29
Prefer enforcement to reminders: If code can check a rule reliably, encode it in a linter, type, script, test, or CI gate.
- Distinctive: line 31
Separate trust domains: Treat model behavior and generated code as untrusted even when the harness is trusted.
- Distinctive: line 36
Do not design from generic best practices alone.
- Distinctive: line 47
If material uncertainty remains, present 2–3 viable architectures with explicit tradeoffs and ask the user to choose.
- Distinctive: line 51
Read references/architecture.md, then choose only the layers the project needs.
- Very specific: line 57
Use agentic-scaffolding/ for the project's scaffold index and the focused architecture, workflow, plan, reference, evaluation, and …
- Distinctive: line 71
Treat this layout as an executable architecture invariant.
- Distinctive: line 77
Use AGENTS.md, CLAUDE.md, or the agent's native equivalent for rules that must be present every session:
- Distinctive: line 86
Keep it compact. Prefer a map to an encyclopedia.
- Distinctive: line 103
Create a skill when a workflow is repeatable, task-specific, too detailed for persistent instructions, and has a concrete output.
- Distinctive: line 155
no raw secrets in model context or generated-code environments
- Distinctive: line 181
Always compare against a baseline without the scaffold.
- Distinctive: line 185
When an agent fails, classify the missing capability before changing prompts:
- Distinctive: line 197
Before relocating files, identify their code, build, documentation, and ticket consumers.
- Distinctive: line 201
Read references/decision-guide.md when choosing among patterns.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agentic Scaffolding
Design the repository as the agent's working environment: durable knowledge, executable constraints, inspectable systems, safe capabilities, and feedback loops. The correct scaffold is project-specific. Derive it from the user's workflow and failure modes; never impose a universal directory tree.
Operating Contract
- Ask before prescribing. Establish who uses the system, what agents do, where they run, and which failures matter.
- Start from friction. Add scaffolding for observed or credible failure modes, not fashion.
- Keep the repository authoritative. Durable decisions, commands, interfaces, plans, and review lessons must be versioned near the code they govern.
- Use progressive disclosure. Persistent context routes; focused sources explain; scripts execute.
- Match documentation to its audience. Private product repositories should avoid
README.mdfiles and use scopedAGENTS.mdfiles for agent-facing guidance. Reserve READMEs for public projects with outside human consumers. - Prefer enforcement to reminders. If code can check a rule reliably, encode it in a linter, type, script, test, or CI gate.
- Verify outcomes in the real surface. Source inspection is not proof of a working application.
- Separate trust domains. Treat model behavior and generated code as untrusted even when the harness is trusted.
- Evaluate every layer. Routing, rule adherence, task outcome, cost, and latency are different measurements.
First: Interview the User
Do not design from generic best practices alone. Use references/discovery.md to resolve the material choices. Ask only questions whose answers change the architecture; inspect the repository first when it can answer them.
At minimum establish:
- Work: task classes, duration, ambiguity, concurrency, and required autonomy.
- People: who assigns work, reviews results, and owns guidance.
- Repository: monorepo/polyrepo, languages, architecture, test/deploy paths, and existing instructions.
- Runtime: local machine, CI, devbox, VM, sandbox, network and secret access.
- Evidence: what proves success—tests, browser paths, previews, logs, metrics, traces, artifacts.
- Pain: repeated mistakes, stale knowledge, unsafe actions, context loss, review bottlenecks, or orchestration overhead.
If material uncertainty remains, present 2–3 viable architectures with explicit tradeoffs and ask the user to choose. Otherwise select the smallest adequate design and state the assumptions.
Design the Scaffold
Read references/architecture.md, then choose only the layers the project needs.
Default repository home
Unless the repository already has a well-established equivalent, create a root agentic-scaffolding/ directory as the durable home for deeper agent-facing material. Keep the root AGENTS.md concise and link from it to agentic-scaffolding/AGENTS.md; do not copy deeper material into the always-loaded file.
Use agentic-scaffolding/ for the project's scaffold index and the focused architecture, workflow, plan, reference, evaluation, and governance artifacts selected below. Keep runtime-discovered files in their required native locations—for example .agents/skills/—and link to them from the scaffold index rather than breaking tool conventions.
Before creating a file, choose its destination from the repository's declared layout, including files produced by other skills. Distinguish source, configuration, generated output, plans, retained research, temporary files, and credentials. Existing root clutter is not a placement convention. Keep retained research in the project's data location, such as data/.
Do not create agentic-scaffolding/scripts/ or agentic-scaffolding/temp/. Executable helpers belong in existing project tooling or a runtime-required native location. Put temporary files in the OS temporary directory ($TMPDIR or /tmp), never in the repository. This includes disposable screenshots, logs, downloads, and intermediate build output; tool-required generated outputs keep their required locations.
In a private product repository, default to a scoped AGENTS.md in each human-maintained directory. Each nested file should state only that directory's local commands, boundaries, ownership, conventions, and routes while inheriting parent guidance; never copy the full parent file. Omit generated, vendored, build-output, and purely organizational directories, and omit any file that would contain no local contract. Public projects may use READMEs for external onboarding, but agent-operational guidance still belongs in AGENTS.md.
The root AGENTS.md should identify agentic-scaffolding/AGENTS.md as the canonical deeper index, route agents to relevant files, and contain only the rules and triggers that must always load.
Default source layout and push gate
Unless an established framework or repository convention requires otherwise, place first-party application and library code under src/, grouped immediately below it by coherent system or component rather than by incidental file type. Keep configuration, generated output, vendored code, migrations, and tool-required entry points in their native locations. Each meaningful src/<system-or-component>/ boundary should have scoped AGENTS.md guidance when it has local rules.
Treat this layout as an executable architecture invariant. Prefer GritQL for structural and dependency rules and Biome for supported lint, format, and import rules. If neither cleanly expresses path placement, add the smallest repository-owned structural check rather than forcing the wrong tool.
Run the canonical architecture, GritQL, and Biome checks from a blocking pre-push hook and from CI. The root AGENTS.md must name the exact command and state: never use --no-verify, disable or edit around the hook, suppress failures, or push while the check is unavailable. Fix violations; if the hook or its dependencies cannot run, stop and report the blocker. CI must run the same command because a local Git hook alone is not an enforceable trust boundary.
1. Persistent policy
Use AGENTS.md, CLAUDE.md, or the agent's native equivalent for rules that must be present every session:
- repository map and canonical sources
- exact build, test, run, and verification entry points
- non-standard architecture, compatibility, security, and data rules
- mandatory if/then workflow triggers
- destructive-action and Git/workspace boundaries
- exact mandatory pre-push command, prohibition on bypassing it, and stop-on-unavailable behavior
Keep it compact. Prefer a map to an encyclopedia. Generic repository summaries often add cost without improving outcomes; persistent context earns its place by routing retrieval or preventing a costly mistake.
2. Repository knowledge
Store durable knowledge in focused, owned files:
- architecture and domain boundaries
- product specifications and accepted decisions
- active/completed execution plans and technical debt
- operational, security, reliability, and performance requirements
- generated schemas and version-matched external references
- examples with rationale, exceptions, and known flaws
Give each source a clear owner and freshness signal. Keep current decisions and operational facts in one canonical source; plans, tickets, and other guidance link to it rather than copy values that can drift.
3. On-demand workflows
Create a skill when a workflow is repeatable, task-specific, too detailed for persistent instructions, and has a concrete output. Each skill needs:
- a precise trigger and explicit non-goals
- a narrow contract and completion condition
- routed references rather than copied knowledge
- deterministic scripts only where mechanics repeat
- verification and a stable result format
Critical skills need an explicit persistent if/then trigger. Availability alone does not guarantee invocation.
4. Executable constraints
Split judgment from mechanics:
- Prose: intent, tradeoffs, product judgment, architecture rationale, exceptions.
- Code: formatting, dependency boundaries, schemas, naming, generated-file rules, required metadata, security checks, and repeatable command sequences.
Custom error messages should tell an agent how to repair the violation. Enforce invariants centrally; allow implementation freedom locally.
5. Legible execution environment
Agents need direct, scoped access to the evidence humans use:
- isolated runnable application per task when practical
- browser or client automation for user-visible paths
- searchable logs, metrics, and traces
- deterministic setup/start/reset commands
- structured command output and retained failure artifacts
- exact links between source, runtime evidence, and acceptance criteria
Expose the smallest sufficient interface. Start with files and standard tools when they preserve structure and remain inspectable; add typed tools for permissioned capabilities, stable service boundaries, or dangerous operations.
For external account or OAuth setup, establish the agent's host and the machine/browser the user can actually see. Use the user's normal browser for provider sign-in. Provide the account/project ID, client type, exact origin and callback where applicable, and private credential destination together. Resolve known values from context before asking. Inspect non-secret credential metadata before activation and verify a real sign-in afterward.
6. Continuity and orchestration
For work that crosses sessions, preserve state outside the context window:
- acceptance criteria or a feature/task ledger
- progress, decisions, discoveries, and remaining work
- clean checkpoints and reproducible startup instructions
- proof artifacts for completed steps
For concurrent autonomous work, use one isolated workspace per task and a durable control plane such as the issue tracker. Model dependencies explicitly. Prefer objectives and observable handoff states over a rigid sequence of model micro-steps.
7. Security boundaries
Map these actors separately: trusted harness, model-driven agent, credentials, generated code, filesystem/environment, network destinations, and external content.
Default controls:
- least-privilege, task-scoped tools
- no raw secrets in model context or generated-code environments
- imported credential files go directly to an ignored private location with owner-only access, never the repository root or tracked guidance
- isolated execution for generated code
- workspace and filesystem boundaries
- egress controls or credential brokering where network access is required
- approvals for irreversible or high-impact actions
- teardown and state cleanup between tasks
A shared sandbox protects the host but does not protect harness credentials from generated code inside that sandbox. For sensitive workloads, separate harness compute from execution compute.
8. Verification and evals
Define proof before increasing autonomy:
- Code contract: focused tests, types, linters, structural checks.
- Application contract: launch the real system and exercise the changed path.
- Operational contract: inspect logs, metrics, traces, migrations, or deployment evidence.
- Handoff contract: attach concise evidence another reviewer can reproduce.
Build evals from real failures and unseen fixtures. Measure separately:
- Did the agent load the right guidance?
- Did it follow the relevant rule?
- Did the final artifact satisfy observable acceptance criteria?
- What did the scaffold cost in tokens, latency, and maintenance?
Always compare against a baseline without the scaffold. Do not interpret compliance as task success.
9. Maintenance loop
When an agent fails, classify the missing capability before changing prompts:
- missing or undiscoverable knowledge → improve the map or canonical source
- missed workflow → fix the trigger or persistent routing
- repeated mechanical violation → add an executable check
- unverifiable result → expose the real surface or signal
- lost state → add a durable progress artifact
- unsafe capability → narrow or isolate the boundary
- ambiguous objective → improve acceptance criteria or issue structure
Promote evidence into the narrowest durable artifact: canonical doc, skill, exemplar, linter, eval, or coverage-gap record. Require human acceptance for changes that encode organizational taste or policy.
Before relocating files, identify their code, build, documentation, and ticket consumers. Update their references with the move, run the affected workflow, and compare output when behavior should stay unchanged. Read back edited ticket links to confirm their saved destination.
Decision Rules
Read references/decision-guide.md when choosing among patterns. Defaults:
- Persistent context for always-applicable policy; skills for vertical workflows.
- A compact retrieval index for broad, version-specific knowledge; not full docs in the prompt.
- Filesystem and standard tools before bespoke retrieval APIs; typed tools at security or semantic boundaries.
- Interactive agents for ambiguous judgment; issue-driven orchestration for routine, well-specified work.
- One agent/workspace per independent task; shared state only through explicit artifacts.
- Hard gates for security, money, data integrity, migrations, and irreversible actions regardless of throughput.
- In private product repositories, scoped
AGENTS.mdfiles over READMEs; READMEs only when external human consumers need public onboarding. - First-party runtime code under
src/, grouped by system or component; GritQL/Biome plus the smallest necessary structural check enforce the boundary. - One canonical blocking pre-push command, repeated in CI; root
AGENTS.mdforbids--no-verify, hook bypass, suppression, or pushing when the check cannot run.
Required Deliverable
Return a project-specific scaffold proposal or implementation with:
- Current-state findings: existing strengths, gaps, and observed failure modes.
- Decisions: chosen layers, rejected alternatives, assumptions, and tradeoffs.
- Artifact map: exact files, tools, ownership, load order, and lifecycle.
- Trust model: actors, secrets, boundaries, approvals, and teardown.
- Verification model: commands and real scenarios proving work.
- Maintenance model: how evidence becomes guidance, enforcement, and evals.
- Adoption sequence: smallest useful first change, then later layers only when justified.
For implementation requests, make the smallest coherent end-to-end change and verify it. For audit or design requests, do not edit unless asked.
Anti-Patterns
- Copying another company's complete tree without matching its workflow.
- A giant context file containing architecture, docs, tutorials, and every command.
- Skills that restate persistent policy or exist without a reliable trigger.
- Tool proliferation that hides data the agent could inspect directly.
- Documentation-only rules that are deterministic enough to enforce.
- Agent-generated context summaries that merely duplicate the repository.
- README proliferation in private product repositories where scoped
AGENTS.mdfiles would provide inherited, enforceable agent guidance. - Declaring completion from a green unit test when the changed user path was never run.
- Shared credentials available to generated code.
- Parallel agents editing one workspace without ownership boundaries.
- Adding autonomy before observability, rollback, and proof-of-work exist.
Sources
See references/sources.md for primary engineering posts, public repository examples, and empirical studies behind these patterns.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

