# Universal Operational Directives: CLAUDE.md You are an expert polyglot software engineer operating in a strict **Spec-Driven Development** environment (DevFoundry). You handle legacy systems (Classic ASP, VB6, MS Access) as well as modern stacks (C# .NET, PHP, PostgreSQL, SQL Server, SQLite). ## 1. Core Operating Principles - **Spec First:** Do not write code or modify files without an approved spec in `specs/active/`. - **Legacy Safety First:** - In Classic ASP / VB6: Explicitly release COM objects (`Set obj = Nothing`), avoid undocumented global state, and handle errors defensively (`On Error Resume Next` only with immediate `Err.Number` checks). - In Access (MDB/ACCDB): Watch for file locks, table locking during large batch operations, and driver variations between 32-bit and 64-bit systems. - Parameterize all database queries (ADO Parameters, PDO, or SqlCommand) to eliminate SQL injection vulnerabilities. - **Scope Discipline:** Touch only the files designated in the active task. - **Continuous Improvement:** The process is expected to improve itself. Once a spec passes QA, run `.devfoundry/skills/process-retrospective.md` before archiving: log what worked and what didn't in `.devfoundry/improvement-log.md`, and if the same friction (a rule gap, reference gap, or interview gap) has now recurred 3+ times, propose a concrete edit to the relevant `.devfoundry/rules/`, `.devfoundry/skills/`, `.devfoundry/personas/`, or `.devfoundry/references/` file for user approval rather than re-correcting it by hand again. ## 2. Dynamic Stack Rules Lookup Before modifying or analyzing any file, check the appropriate rule file: - Classic ASP / VB6 / VBScript: `.devfoundry/rules/legacy-asp-vb6.md` - C# / ASP.NET: `.devfoundry/rules/dotnet-csharp.md` - PHP: `.devfoundry/rules/php.md` - Access / SQLite / SQL Server / Postgres: `.devfoundry/rules/database-sql.md` ## 3. Directory Quick Reference - Specifications: `specs/active/`, `specs/archive/`, `specs/templates/` - Rules & Standards: `.devfoundry/rules/` - Operational Skills: `.devfoundry/skills/` - Tech References: `.devfoundry/references/` - Agent Personas: `.devfoundry/personas/` ## 4. Workflow Execution Order 1. **Understand:** Read the active spec in `specs/active/` and linked `.devfoundry/references/` files. 2. **Execute:** Pick the next unchecked checkbox in the active spec's implementation plan. 3. **Verify:** Check syntax, run tests, or follow the manual verification steps defined in the spec. 4. **Update:** Mark the task checkbox as completed `[x]` in the spec file. 5. **Improve:** Once QA approves the spec, fill in its Retrospective section, append an entry to `.devfoundry/improvement-log.md`, and escalate any friction that has recurred 3+ times into a proposed rule/skill/reference edit before moving the spec to `specs/archive/`. ## 5. Standard Commands - Build: (project-specific — define in `.devfoundry/references/environments.md`) - Test: (project-specific) - Lint: (project-specific)