ast-template-engineer
Skill4 starsChanged 2 months agoApache-2.0View on GitHub
Protocol for safely modifying TypeScript AST templates, enforcing compilation checks and a strict two-strike fallback rule. Trigger on requests like "edit the template", "modify packages/engine/src/plan/templates", "update the AST generator".
In this repository22 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- architecture-doc-writerSkill
- ast-template-engineerSkill
- axis-closure-matrixSkill
- commit-writerSkill
- framework-quality-auditSkill
- protocol-123Skill
- protocol-456Skill
- sdd-plan-writerSkill
- stack-scalerSkill
- strategic-architecture-advisorSkill
- architecture-doc-writerSkill
- axis-closure-matrixSkill
- commit-writerSkill
- framework-quality-auditSkill
- protocol-123Skill
- protocol-456Skill
- sdd-plan-writerSkill
- stack-scalerSkill
- strategic-architecture-advisorSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
After modifying > 0 lines in an AST template file, you MUST verify its syntax before proposing the change to the user or making a commit.
- Distinctive: line 22
If the exit code is > 0, you MUST NOT proceed.
- Distinctive: line 26
If your compilation check fails >= 2 times consecutively on the same file, you MUST abort the modification.
- Very specific: line 32
DO NOT: use the Edit tool for template refactors if the string spans > 50 lines.
- Very specific: line 33
DO NOT: remove existing ${} interpolation variables unless explicitly requested by the user.
≈ “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
AST Template Engineer Skill
Purpose
This skill dictates how AI agents must modify TypeScript template literals (AST generators) inside the EITR engine. It guarantees that generated code templates remain syntactically valid TypeScript and prevents broken string interpolations.
Trigger this skill automatically whenever you modify > 0 files matching the path packages/engine/src/**/templates/*.ts.
Rules & Constraints
1. Mandatory Compilation Check
After modifying > 0 lines in an AST template file, you MUST verify its syntax before proposing the change to the user or making a commit.
- Execute exactly:
npm run typecheck(ornpx tsc --noEmit <path-to-file>). - If the exit code is > 0, you MUST NOT proceed. You must read the error output and attempt a fix.
2. The Fallback Rule (Two-Strike Limit)
- If your compilation check fails >= 2 times consecutively on the same file, you MUST abort the modification.
- Execute exactly:
git checkout -- <file>to revert the file to its last committed state. - Output exactly: "ABORT: Reverting due to unresolvable AST compilation error."
3. Boundary Constraints & Safety
- DO NOT use the
Edittool for template refactors if the string spans > 50 lines. If modifying >50 lines, rewrite the specific AST node entirely. - DO NOT remove existing
${}interpolation variables unless explicitly requested by the user.
Examples
Good Example
1. Modified `packages/engine/src/plan/templates/playwright.ts`.
2. Executed `npm run typecheck`.
3. Received exit code 1 (Missing backtick on line 45).
4. Fixed the missing backtick.
5. Re-ran `npm run typecheck`. Received exit code 0.Bad Example
1. I updated the template string for the Java generator.
2. The code looks correct to me, so I will commit it now.
_(Violation: Did not run `npm run typecheck`. Relied on visual inspection instead of a deterministic compiler check.)_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.

