MHA
Copilot instructions387 starsChanged 11 months agoMITView on GitHub
Message Header Analyzer (MHA) - Outlook add-in for analyzing email headers. See README.md for full feature list and usage. Development Workflow: - User runs npm run dev-server for local development - don't ask to build unless there are errors - Webpack handles compilation and hot reload automatically - Test in Outlook Desktop with Debug tasks when needed ❌ Disabling ESLint rules to bypass problems ❌ Using any or unknown without type assertions ❌ Adding TODO/Phase comments in code ❌ Keeping…
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
24 rules. About 0 are common, 19 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈19
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Test in Outlook Desktop with Debug tasks when needed
- Distinctive: line 12
Zero tolerance for errors AND warnings: ALL errors and warnings from ANY source (build, TypeScript, ESLint, tests) must be fixed - warnings …
- Distinctive: line 14
Check in frequently: Commit often for incremental testing
- Distinctive: line 16
No legacy code: Remove old code completely when updating
- Distinctive: line 17
No process comments: Don't add "Phase 1", "TODO", or development process comments
- Very specific: line 18
Keep README current: When adding features/commands/options, update README.md in the same change
- Distinctive: line 19
Don't create markdown files: Never create new .md files (README, TODO, etc.) without being asked
- Distinctive: line 20
Let user commit: Don't auto-commit changes - present what's done and let user commit when ready
- Distinctive: line 21
Complete all planned work: When outlining a multi-step plan, implement ALL parts - don't stop partway and declare "good enough".
- Distinctive: line 24
No deferring without permission: Never skip fixing something because it seems hard or time-consuming.
- Distinctive: line 29
Pure TypeScript: No JavaScript files - everything must be .ts
- Very specific: line 33
Never use
unknowntype: - use proper types or type assertions - Very specific: line 36
Use type assertions (as Type) when unavoidable
- Distinctive: line 39
No inline code or styles: Keep JavaScript and CSS in separate files
- Distinctive: line 40
Use external TypeScript modules compiled to ES modules
- Distinctive: line 41
Use external CSS files linked in HTML
- Distinctive: line 53
Use try/catch only when required by dependencies
- Distinctive: line 80
All tests must pass before committing
- Distinctive: line 81
Test failures are NEVER expected - if tests fail, fix the code or fix the tests
- Very specific: line 82
Run npm test after any code changes
- Very specific: line 83
Run npm run lint to verify no ESLint errors
- Distinctive: line 87
When fixing bugs identified in code reviews or reported issues:
- Distinctive: line 89
Write failing test first: Create a test that demonstrates the bug - it MUST FAIL with the current buggy code
- Distinctive: line 91
Verify test passes: Run the test again - it should now PASS with the fixed code
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions 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
Project Context
Message Header Analyzer (MHA) - Outlook add-in for analyzing email headers. See README.md for full feature list and usage.
Development Workflow:
- User runs
npm run dev-serverfor local development - don't ask to build unless there are errors - Webpack handles compilation and hot reload automatically
- Test in Outlook Desktop with Debug tasks when needed
Development Principles
- Zero tolerance for errors AND warnings: ALL errors and warnings from ANY source (build, TypeScript, ESLint, tests) must be fixed - warnings are errors, don't introduce problems
- Stop on unexpected errors: Present options instead of chasing fixes wildly
- Check in frequently: Commit often for incremental testing
- Minimal dependencies: Discuss before adding new packages
- No legacy code: Remove old code completely when updating
- No process comments: Don't add "Phase 1", "TODO", or development process comments
- Keep README current: When adding features/commands/options, update README.md in the same change
- Don't create markdown files: Never create new .md files (README, TODO, etc.) without being asked
- Let user commit: Don't auto-commit changes - present what's done and let user commit when ready
- Complete all planned work: When outlining a multi-step plan, implement ALL parts - don't stop partway and declare "good enough". Only the user decides when work is complete.
- Don't duplicate functionality: Reuse existing code when possible - if unsure about options, ask first
- Fix everything you find: When user says "fix X", fix ALL instances of X everywhere. If you find related issues while fixing, fix those too. Don't say "this is for later" - either fix it now or explicitly offer to add it to TODO.md. The user will tell you if something should be deferred.
- No deferring without permission: Never skip fixing something because it seems hard or time-consuming. If you think something should be deferred, explicitly ask: "Should I add this to TODO.md or fix it now?"
Code Standards
TypeScript
- Pure TypeScript: No JavaScript files - everything must be .ts
- Pure ES Modules:
"type": "module"in package.json, no CommonJS - Strict mode with all safety flags enabled
- No implicit
any - Never use
unknowntype - use proper types or type assertions - No unsafe operations
- Explicit return types required
- Use type assertions (
as Type) when unavoidable
HTML/CSS
- No inline code or styles: Keep JavaScript and CSS in separate files
- Use external TypeScript modules compiled to ES modules
- Use external CSS files linked in HTML
ESLint
- Max complexity: 15 (only ignore for legitimately complex functions)
- Explicit function return types required
- No
anytypes - K&R brace style
- No trailing whitespace: ESLint will fail on any trailing spaces or extra blank lines - never add them
- Fix issues properly - never disable rules to bypass problems
Error Handling
- Let errors propagate naturally with typed errors
- Use try/catch only when required by dependencies
- Provide meaningful error messages
Common Patterns
Type Assertions (when unavoidable)
const data = JSON.parse(jsonString) as SomeType[];
const element = document.getElementById('id') as HTMLElement;Complexity Exceptions (use sparingly)
// eslint-disable-next-line complexity
async function legitimatelyComplexFunction() { }Anti-Patterns to Avoid
❌ Disabling ESLint rules to bypass problems
❌ Using any or unknown without type assertions
❌ Adding TODO/Phase comments in code
❌ Keeping deprecated/legacy code
❌ Guessing at fixes - stop and ask instead
Testing Requirements
- All tests must pass before committing
- Test failures are NEVER expected - if tests fail, fix the code or fix the tests
- Run
npm testafter any code changes - Run
npm run lintto verify no ESLint errors
TDD Approach for Bug Fixes
When fixing bugs identified in code reviews or reported issues:
- Write failing test first: Create a test that demonstrates the bug - it MUST FAIL with the current buggy code
- Apply the fix: Implement the code changes to address the bug
- Verify test passes: Run the test again - it should now PASS with the fixed code
- If test still fails: Reconsider whether the fix is incorrect OR the test is incorrect
- If test was incorrect: Fix the test, then retest with OLD buggy code to verify it fails there, then retest with NEW fixed code to verify it passes
This approach ensures:
- The bug actually exists and is reproducible
- The fix actually solves the problem
- We have regression protection going forward
Workflow for Changes
Development:
- User runs
npm run dev-server- don't ask to start it - Webpack dev server handles compilation and hot reload
- Make code changes and test in browser/Outlook
Testing:
npm test- Run testsnpm run lint- ESLint checknpm run lint:fix- Auto-fix ESLint issues
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.

