TaskSync
Copilot instructions634 starsChanged 7 months agoMITArchived repositoryView on GitHub
TaskSync is a human-in-the-loop workflow toolkit for AI-assisted development. The primary codebase is the VS Code extension in tasksync-chat/. It provides a sidebar with smart prompt queuing, Autopilot mode, and remote access via WebSocket. All commands run from tasksync-chat/: Or run individually: Always run these four checks (build, tsc, vitest, lint) after making changes. The CI workflow (.github/workflows/auto-release.yml) runs on pushes to main — it installs deps, builds, version-bumps, packages VSIX, and creates a GitHub release. Build output: dist/ (extension…
- Installs packages
We split this copilot-instructions.md into the rules it gives an agent
17 rules. About 0 are common, 5 are distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 27
All commands run from tasksync-chat/:
- Very specific: line 45
Always run these four checks (build, tsc, vitest, lint) after making changes.
- Very specific: line 55
Type assertions: Use satisfies over as (e.g., } satisfies ToWebviewMessage).
- Distinctive: line 56
Async I/O: Always prefer async file operations over synchronous equivalents.
- Very specific: line 57
Logging: Use debugLog() from webviewUtils.ts (gated behind tasksync.debugLogging config).
- Very specific: line 58
Changelog: Update CHANGELOG.md for every user-facing change using the format ## TaskSync vX.Y.Z (MM-DD-YY) (two-digit year).
- Very specific: line 64
Single Source of Truth (SSOT): Every concept, constant, type, or piece of logic must have exactly one canonical definition.
- Very specific: line 65
Don't Repeat Yourself (DRY): If logic is used in more than one place, extract it into a shared helper.
- Distinctive: line 66
Keep It Simple, Stupid (KISS): Prefer the simplest solution that works.
- Distinctive: line 67
You Aren't Gonna Need It (YAGNI): Do not add features, parameters, or code paths "just in case." Only implement what is needed for the …
- Very specific: line 68
Handler pattern: All handler modules (*Handlers.ts) receive a P interface — do not add direct imports from webviewProvider.ts.
- Distinctive: line 72
Follow OWASP Top 10 principles.
- Very specific: line 74
Timing-safe comparison: Use crypto.timingSafeEqual with fixed-length digests (SHA-256) for PIN/secret comparison — never early-return on …
- Very specific: line 75
Path traversal prevention: All file paths from remote clients must be validated with isValidFilePath() in gitService.ts — rejects .., …
- Very specific: line 76
Command injection prevention: Use child_process.spawn with argument arrays — never exec or string interpolation in shell commands.
- Distinctive: line 77
No credentials in code: Never commit secrets, API keys, or tokens.
- Very specific: line 81
Origin validation: Check Origin and Host headers on WebSocket upgrade requests.
≈ “Common” is an estimate: at least 1 in 5 of the 3,669 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
TaskSync — Copilot Repository Instructions
What This Repository Does
TaskSync is a human-in-the-loop workflow toolkit for AI-assisted development. The primary codebase is the VS Code extension in tasksync-chat/. It provides a sidebar with smart prompt queuing, Autopilot mode, and remote access via WebSocket.
Project Layout
tasksync-chat/src/extension.ts— Extension entry pointtasksync-chat/src/tools.ts— VS Code language model tool definitions (ask_user)tasksync-chat/src/webview/webviewProvider.ts— Orchestrator: owns state, creates webview, delegates to handlerstasksync-chat/src/webview/webviewTypes.ts— Shared types (Pinterface, message unions)tasksync-chat/src/webview/webviewUtils.ts— Shared helpers (debugLog(),mergeAndDedup(),notifyQueueChanged())tasksync-chat/src/webview/*Handlers.ts— Handler modules receive aPinterface (no circular imports)tasksync-chat/src/server/— Remote server, auth, git operations, HTML servicetasksync-chat/src/constants/— Shared constants (config keys, file exclusions, remote constants)tasksync-chat/src/context/— Context providers (files, terminal, problems)tasksync-chat/src/utils/— Utilities (ID generation, image handling)tasksync-chat/esbuild.js— Build script (extension, webview, shared constants, mermaid)tasksync-chat/biome.json— Biome linter/formatter configtasksync-chat/vitest.config.ts— Test configtasksync-chat/web/— Remote access PWA (login, service worker)Prompt/— Standalone prompt/protocol markdown files (not actively developed)
Build, Test, and Validate
All commands run from tasksync-chat/:
cd tasksync-chat
npm install # Always run first
npm run validate # Full validation: build + tsc + test + lint + code quality scannerOr run individually:
node esbuild.js # Build → dist/extension.js, media/webview.js, web/shared-constants.js
npx tsc --noEmit # Type-check (must produce 0 errors)
npx vitest run # Run all tests (387+ tests, must all pass)
npm run lint # Biome lint (must produce 0 issues)
npm run check-code # Code quality scanner (duplicates, sync I/O, etc.)Always run these four checks (build, tsc, vitest, lint) after making changes. The CI workflow (.github/workflows/auto-release.yml) runs on pushes to main — it installs deps, builds, version-bumps, packages VSIX, and creates a GitHub release.
Build output: dist/ (extension bundle), media/webview.js (webview bundle), web/shared-constants.js (auto-generated for remote PWA).
Code Style and Conventions
- TypeScript with
"strict": true, ES2022 target, CommonJS modules - Indentation: Tabs (enforced by Biome)
- Quotes: Double quotes (enforced by Biome)
- Imports: Auto-organized by Biome (
organizeImports: on) - Type assertions: Use
satisfiesoveras(e.g.,} satisfies ToWebviewMessage).satisfiesvalidates shape at compile time;assilently bypasses checks. - Async I/O: Always prefer async file operations over synchronous equivalents. Never use synchronous blocking calls on the extension host.
- Logging: Use
debugLog()fromwebviewUtils.ts(gated behindtasksync.debugLoggingconfig). Useconsole.erroronly for genuine errors. Never useconsole.logorconsole.warnin production code. - Changelog: Update
CHANGELOG.mdfor every user-facing change using the format## TaskSync vX.Y.Z (MM-DD-YY)(two-digit year).
SSOT / DRY / KISS / YAGNI Principles
These principles are mandatory for all changes:
- Single Source of Truth (SSOT): Every concept, constant, type, or piece of logic must have exactly one canonical definition. Do not duplicate config keys, message types, validation logic, or shared helpers. Constants live in
src/constants/. Shared types live inwebviewTypes.ts. Shared helpers live inwebviewUtils.ts. - Don't Repeat Yourself (DRY): If logic is used in more than one place, extract it into a shared helper. Examples already in the codebase:
debugLog(),mergeAndDedup(),notifyQueueChanged(),hasQueuedItems(),resolveFilePath()(gitService). When you see the same pattern in 3+ call sites, extract it. - Keep It Simple, Stupid (KISS): Prefer the simplest solution that works. Do not add abstraction layers, configuration options, or indirection without clear justification. A small amount of duplication is acceptable if the alternative is a complex abstraction for only 2 call sites.
- You Aren't Gonna Need It (YAGNI): Do not add features, parameters, or code paths "just in case." Only implement what is needed for the current task. Do not design for hypothetical future requirements.
- Handler pattern: All handler modules (
*Handlers.ts) receive aPinterface — do not add direct imports fromwebviewProvider.ts. This prevents circular dependencies.
Security Best Practices
Follow OWASP Top 10 principles. Specific patterns enforced in this codebase:
- Timing-safe comparison: Use
crypto.timingSafeEqualwith fixed-length digests (SHA-256) for PIN/secret comparison — never early-return on length differences. SeeremoteAuthService.tscomparePinTimingSafe(). - Path traversal prevention: All file paths from remote clients must be validated with
isValidFilePath()ingitService.ts— rejects.., absolute paths (when no workspace), null bytes, backticks, and shells metacharacters. Usepath.isAbsolute()instead ofstartsWith("/")for cross-platform correctness. - Command injection prevention: Use
child_process.spawnwith argument arrays — neverexecor string interpolation in shell commands. SeegitService.tsunstage(). - No credentials in code: Never commit secrets, API keys, or tokens. Auth uses ephemeral PINs with session tokens and lockout after failed attempts.
- Input validation at boundaries: Validate all user/remote input at the entry point. Trust internal code and framework guarantees — do not add redundant validation deep in call stacks.
- TLS certificates:
generateSelfSignedCertstrips ports and brackets from hosts before SAN detection. Always test IPv4, IPv6 (::1), bracketed IPv6 ([::1]:port), and hostname:port formats. - Security headers: Set
Content-Security-Policy,X-Content-Type-Options,X-Frame-Options, andX-XSS-Protectionon all HTTP responses. SeeserverUtils.tssetSecurityHeaders(). - Origin validation: Check
OriginandHostheaders on WebSocket upgrade requests. SeeserverUtils.tsisAllowedOrigin().
Testing Strategy
- Framework: Vitest, 14 test files, 387+ tests, ~98% coverage
- VS Code mock:
src/__mocks__/vscode.ts— mocks VS Code API for unit tests - Test setup: Tests that use git operations must set
(vscode.workspace as any).workspaceFoldersinbeforeEach - Coverage requirement: Maintain or improve coverage. Add tests for new logic, especially:
- Security-sensitive code (auth, path validation, input parsing)
- Edge cases in parsing (IPv6, ports, special characters)
- Error handling paths
Architecture Notes
- The
ask_usertool (registered intools.ts, handled intoolCallHandler.ts) is the core interaction primitive. - Queue, history, and settings are per-workspace (workspace-scoped storage with global fallback).
- Session state uses a boolean
sessionTerminatedflag — do not use string matching for termination detection. - Debounced history saves (2 s) for disk I/O performance.
- Remote server uses WebSocket over HTTP with PIN-based auth and session tokens.
esbuild.jswatch mode monitorsremoteConstants.tschanges and rebuilds shared constants with 100ms debounce.
Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.
Of the Copilot instructions files we read, the 2,297 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- AGENTS.mdAGENTS.md
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.

