agentleFS
Hive-AcademyHive-Academy/PtahCode/.github/copilot-instructions.md

PtahCode

Copilot instructions34 starsChanged 9 days agoMITView on GitHub

Apply this three-phase review protocol. Be adversarial — find how code breaks, not how it works. Never rubber-stamp. Every review must find 3+ issues. Assume every line will fail in the worst way. Answer these 5 questions: Critical smells to flag: Severity: Data loss or silent failures → CRITICAL. Missing error handling → SERIOUS. Default to higher severity when unsure. Every line must justify its existence. Answer these 5 questions: Project patterns to enforce: OWASP-aligned assessment adapted for the Electron…

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this copilot-instructions.md into the rules it gives an agent

6 rules. About 1 is common, 5 are distinctive, and 0 are very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every line must justify its existence.

    line 30
  2. Distinctive:

    No TODO/FIXME without linked issue, no stub implementations

    line 48
  3. Distinctive:

    No console.log in production paths

    line 49
  4. Distinctive:

    No hardcoded secrets: API keys, tokens, passwords, connection strings in source

    line 58
  5. Distinctive:

    No authentication bypasses or privilege escalation paths

    line 61
  6. Common:

    No PII/sensitive data in logs or error messages

    line 62

≈ “Common” is an estimate: at least 1 in 5 of the 3,779 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

Code Review Instructions

Apply this three-phase review protocol. Be adversarial — find how code breaks, not how it works. Never rubber-stamp. Every review must find 3+ issues.

Phase 1: Code Logic Review (40% weight)

Assume every line will fail in the worst way.

Answer these 5 questions:

  1. How does this fail silently? — catch blocks that log but don't propagate to UI, promises without error handling
  2. What user action causes unexpected behavior? — rapid clicks, tab switches mid-operation, navigation during async work
  3. What data produces wrong results? — null/undefined inputs, empty arrays, malformed responses, extremely large datasets
  4. What happens when dependencies fail? — network failures, timeouts, service unavailability, stale state
  5. What's missing that requirements didn't mention? — offline behavior, cleanup on destroy, concurrent operations, retry logic

Critical smells to flag:

  • Silent failures: catch blocks that swallow errors while UI shows success
  • Race conditions: state checked in one tick, used in another without re-validation
  • State inconsistency: mutations without synchronized UI updates
  • Fire-and-forget: async calls without error handling or user feedback
  • Missing cleanup: subscriptions, timers, event listeners not disposed on destroy
  • Stale closures: callbacks capturing state that changes before execution

Severity: Data loss or silent failures → CRITICAL. Missing error handling → SERIOUS. Default to higher severity when unsure.

Phase 2: Code Style & Patterns Review (35% weight)

Every line must justify its existence.

Answer these 5 questions:

  1. What breaks in 6 months? — fragile coupling, magic strings, implicit dependencies
  2. What confuses a new team member? — unclear data flow, non-obvious side effects, hidden state
  3. What's the hidden complexity cost? — premature abstractions, over-engineering, unnecessary indirection
  4. What pattern inconsistencies exist? — deviations from established codebase conventions
  5. What would I do differently? — simpler alternatives, better naming, clearer structure

Project patterns to enforce:

  • Angular signals for all frontend state (never RxJS BehaviorSubject for state)
  • Branded types (SessionId, MessageId) — never raw strings for IDs
  • Strict layering: libs depend only on layers below, no circular deps
  • Standalone components with zoneless change detection (no NgModules)
  • tsyringe DI with tokens from vscode-core for backend services
  • No any types, no unsafe type assertions hiding nullability
  • No TODO/FIXME without linked issue, no stub implementations
  • No console.log in production paths
  • Single responsibility per function; extract at nesting depth > 3

Phase 3: Security Review (25% weight)

OWASP-aligned assessment adapted for the Electron desktop app.

Always check:

  • No hardcoded secrets: API keys, tokens, passwords, connection strings in source
  • Input validation: all external input sanitized before use
  • Injection prevention: no raw string concatenation in queries, commands, or file paths
  • No authentication bypasses or privilege escalation paths
  • No PII/sensitive data in logs or error messages
  • No eval() or dynamic code execution
  • Renderer windows keep contextIsolation: true, nodeIntegration: false and sandbox: true
  • Renderer ↔ main process messages (preload bridge, RPC) validated on both sides
  • File system access uses proper path validation (no path traversal)
  • Least privilege for the preload bridge, IPC channels and spawned processes
  • Dependencies: flag known-vulnerable packages

Scoring

ScoreMeaningFrequency
9-10Handles all edge cases, production-hardened<5%
7-8Good, minor improvements needed20%
5-6Core works, gaps in coverage50%
3-4Significant logic gaps or silent failures20%
1-2Fundamental errors5%

Best reviews make the author say "I hadn't thought of that."

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.