Cheshi
AGENTS.md19 starsChanged 47 days agoMITView on GitHub
These instructions apply to the entire repository. Model selection and reasoning effort belong to the active runtime; this file defines the repository's working agreements. - Complete the requested work, including relevant validation, within the agreed scope. Use conversation context to resolve routine implementation choices. - Obtain explicit user approval before creating, editing, deleting, or renaming code, including tests, styles, scripts, and configuration that affects runtime behavior. First investigate and describe the proposed files, changes, reasons, and validation plan, then wait…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,040 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 repository6 other files it gives its agents.
- desktop/AGENTS.mdAGENTS.md
- desktop-buildSkill
- desktop-ui-checkSkill
- desktop-ui-verificationSkill
- easy-explainSkill
- homie-createSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
69 rules. About 4 are common, 40 are distinctive, and 25 are very specific to this project.
≈4
Common · estimate
Many files like this have a rule of this kind.
≈40
Distinctive · estimate
This author's own choices. Worth a look.
25
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
If the user has already explicitly approved the same concrete change, proceed within that scope without requesting the same approval again.
- Distinctive: line 18
Read-only inspection, analysis, and relevant validation may proceed before code-change approval, subject to the existing permission and …
- Distinctive: line 33
When actual work shows that a repository rule or user direction limits a better solution, proactively explain the specific constraint and a …
- Distinctive: line 38
Ask a focused question when required approval is missing or missing information materially changes the scope or blocks correct execution.
- Distinctive: line 41
If a rule or tool approval blocks work, identify the exact instruction or rejection and its source.
- Distinctive: line 43
Treat corrections and status questions as part of the ongoing task.
- Distinctive: line 45
Before saving project information, learned findings, or other content to persistent memory, tell the user what will be saved and where, ask …
- Distinctive: line 49
Use judgment to decide when and how often to propose memory updates based on lasting usefulness, novelty, and relevance to future work.
- Distinctive: line 53
Use parallel tool calls for independent reads and checks.
- Distinctive: line 56
When delegation is requested, assign bounded tasks with clear file ownership, coordinate shared dependencies, and personally review the …
- Distinctive: line 60
Use the user's requested language.
- Distinctive: line 75
Prefer feature and service boundaries compatible with an MSA monorepo.
- Very specific: line 81
Use Bun for dependency management and routine scripts.
- Very specific: line 83
Use cheshi-cli codegraph ...
- Very specific: line 96
Before using CodeGraph or the desktop app, read .docs/codegraph/guide.md once for the current task.
- Very specific: line 98
Check command options against CLI help and script names against package.json when a documented command is unavailable.
- Very specific: line 101
If status reports initialized: false, use ordinary source inspection.
- Distinctive: line 103
If status or queries fail, or CodeGraph is unavailable, briefly report the limitation and continue with ordinary source inspection in the …
- Distinctive: line 106
If results are stale or contradict current source, read the affected source directly and use it as the authority.
- Distinctive: line 110
Read only uncovered or explicitly stale ranges directly.
- Distinctive: line 118
Keep viewer inspection read-only.
- Distinctive: line 143
Keep import checks free of app startup, provider requests, and other external side effects.
- Distinctive: line 161
Do not suppress these warnings with inspection comments when the asynchronous control flow can be expressed clearly in code.
- Very specific: line 174
When interpreting an external value as true, require the actual literal true.
- Very specific: line 177
When validation inside a recovery try/catch must fail by throwing, move the throw into a named assertion helper while preserving the …
- Distinctive: line 181
Do not leave unused imports, types, functions, or methods in the codebase.
- Distinctive: line 185
Do not silence Qodana, IDE, linter, compiler, or static-analysis findings with suppression comments.
- Distinctive: line 190
When a test double intentionally returns malformed data, explicitly type its parameters and keep any unsafe cast confined to the injected …
- Very specific: line 209
Use bun test <test-file> for Bun suites.
- Distinctive: line 216
After checks pass, repeat or expand them only for a new edit, failure, unresolved concern, or explicit user request.
- Distinctive: line 218
When a test or validation command fails with evidence of sandbox or permission restrictions, first rerun the affected check in an approved …
- Distinctive: line 241
After the final edit, formatter, and relevant checks, inspect only those paths in their current on-disk state.
- Distinctive: line 255
Keep authored modules within 1,000 lines when implementing or refactoring within the authorized scope.
- Distinctive: line 261
Do not compress formatting or remove useful documentation just to reduce the count.
- Very specific: line 273
Use 12px as the default UI font size.
- Very specific: line 275
Use 16px as the default spacing value for gap, padding, margin, and related layout spacing.
- Very specific: line 278
Use 15px × 15px as the default SVG icon size through --icon-size-default.
- Very specific: line 281
Use --icon-default for adjacent icon-only controls.
- Very specific: line 285
Use icons from the official Lucide icon set.
- Very specific: line 291
Use the shared LiquidGlassPanel exported from desktop/frontend/src/shared/ui for reusable panel wrappers.
- Very specific: line 295
Read LiquidGlassPanel.module.css and the relevant shared control styles before changing their appearance.
- Very specific: line 299
Keep shared borders, radii, and backdrop effects in the shared component.
- Very specific: line 327
When controlling Cheshi through Computer Use, never target the app with the generic name Electron or the shared bundle identifier …
- Very specific: line 331
Treat app-selection and state-reading APIs as potentially launching a target.
- Very specific: line 332
Do not probe candidate Electron application paths with them merely to discover which one is Cheshi.
- Very specific: line 338
Do not open or control an Electron binary from another project unless the user explicitly places that project in scope.
- Distinctive: line 346
Create a Git commit only when the user explicitly requests a commit.
- Distinctive: line 349
Use the requested/current branch and its configured remote.
- Distinctive: line 351
Commit messages must use a lowercase flag in square brackets followed by a concise imperative summary in lowercase English.
- Very specific: line 356
Use the format: [flag] summary.
- Very specific: line 368
Use the path format ../<project>-<branch-slug>.
- Distinctive: line 371
Use the user's specified base branch or commit for a new worktree.
- Distinctive: line 373
Default to main for new independent work when no base has been specified.
- Very specific: line 376
Create the worktree with the chosen base substituted for <base>: git worktree add -b worktree/<type>/<name> ../<project>-<branch-slug> …
- Distinctive: line 378
Check existing worktrees with git worktree list before creating one.
- Distinctive: line 379
Never remove a worktree with uncommitted changes without explicit approval.
- Very specific: line 380
Remove completed worktrees with: git worktree remove ../<project>-<branch-slug>
- Distinctive: line 382
Run git worktree prune only to clean stale worktree metadata.
- Very specific: line 388
Use gh auth status only for GitHub CLI/API work or to diagnose its failure.
- Distinctive: line 392
If verification is unavailable, report that limitation.
- Distinctive: line 399
Prefer recoverable operations where practical.
- Distinctive: line 400
Do not use broad recursive destructive commands against the project root, the home directory, or unresolved paths.
- Distinctive: line 404
Before every commit, inspect the staged file list and staged diff to confirm that only files belonging to the requested change are included.
- Common: line 405
Before committing, scan the staged changes for API keys, tokens, passwords, private keys, credentials, and authentication files.
- Common: line 409
Check that generated build outputs, logs, temporary files, local databases, credential stores, and machine-specific files are not included …
- Common: line 410
If an unnecessary file or possible secret is found, stop the commit or push until it has been removed or the user has explicitly confirmed …
- Common: line 411
Never print a complete secret while scanning or reporting findings.
- Distinctive: line 412
After pushing, confirm the upstream is synchronized and report any remaining worktree changes.
- Distinctive: line 417
Keep repository-specific commands and constraints here.
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md 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
Repository Instructions
These instructions apply to the entire repository. Model selection and reasoning effort belong to the active runtime; this file defines the repository's working agreements.
Working agreements
- Complete the requested work, including relevant validation, within the agreed scope. Use conversation context to resolve routine implementation choices.
- Obtain explicit user approval before creating, editing, deleting, or renaming code, including tests, styles, scripts, and configuration that affects runtime behavior. First investigate and describe the proposed files, changes, reasons, and validation plan, then wait for approval before applying the changes. Requests to inspect, diagnose, or verify do not authorize code changes. If the user has already explicitly approved the same concrete change, proceed within that scope without requesting the same approval again.
- Read-only inspection, analysis, and relevant validation may proceed before code-change approval, subject to the existing permission and UI-review rules. Validation may produce normal generated build or test output, but must not rewrite authored files through formatters, automatic fixes, or snapshot updates without approval. Delegated code changes require the same approval.
- Decide file organization, naming, internal design, work order, and validation methods autonomously within the approved change scope and repository conventions. Obtain approval for choices that materially change the intended result or scope.
- Report adjacent issues discovered during implementation or validation and propose any necessary fixes. Apply them only when covered by the user's explicit approval; otherwise continue independent, approved work while waiting. Propose independent features or large structural changes separately before expanding the scope.
- Respect current user directions over repository defaults and skill guidance, within the runtime's instruction hierarchy. Keep unrelated changes intact.
- When actual work shows that a repository rule or user direction limits a better solution, proactively explain the specific constraint and a concrete example, then propose an alternative and a focused adjustment with its benefits and tradeoffs. Continue authorized work where possible and follow the current instruction until the user approves changing it.
- Ask a focused question when required approval is missing or missing information materially changes the scope or blocks correct execution. Continue independent, authorized work while waiting. Do not request the same authorization twice.
- If a rule or tool approval blocks work, identify the exact instruction or rejection and its source. Prepare the reviewable result as far as authorized.
- Treat corrections and status questions as part of the ongoing task. Preserve decisions, completed checks, and remaining work across context compaction.
- Before saving project information, learned findings, or other content to persistent memory, tell the user what will be saved and where, ask for permission, and wait for explicit approval. Apply this to both new memory entries and updates to existing memories.
- Use judgment to decide when and how often to propose memory updates based on lasting usefulness, novelty, and relevance to future work. Group related findings into one proposal when practical to avoid unnecessary interruptions; this discretion does not authorize saving without the user's approval.
- Use parallel tool calls for independent reads and checks. Keep dependent operations and edits sequential. Create subagents or delegate tasks only when the user explicitly requests it. Ordinary parallel tool calls remain allowed. When delegation is requested, assign bounded tasks with clear file ownership, coordinate shared dependencies, and personally review the combined result and relevant validation. Delegation follows the same scope and approval requirements as work performed directly.
- Use the user's requested language. Lead with the result, give brief progress updates during sustained work, and report concrete changes, checks, and unresolved issues without repeating the work log.
Repository boundaries and tooling
cli/cheshi-cli.ts: public CLI entry point.codegraph/: indexing, extraction, search, graph, and MCP engine.desktop/main.mts,desktop/preload.cts,desktop/lib/: Electron lifecycle, IPC bridge, and desktop services. Keep orchestration separate from service logic.desktop/backend/codegraph-server/: CodeGraph HTTP API.desktop/frontend/src/features/: feature UI and state; shared controls belong indesktop/frontend/src/shared/ui/.desktop/native/,config/,scripts/,forge.config.mts: native integration, configuration, development tooling, and packaging.- Prefer feature and service boundaries compatible with an MSA monorepo. Split modules by responsibility, make dependency direction explicit, and preserve public contracts and behavior. Introduce independently deployed services or new communication layers only when included in the requested scope.
- Author JavaScript-family code in
.ts,.mts,.tsx, or.ctsas appropriate. Edit source files rather than generated.js,.mjs, or.cjsartifacts. - Use Bun for dependency management and routine scripts. Check
package.jsonfor current command names; do not substitute npm or pnpm without a task reason. - Use
cheshi-cli codegraph ...publicly, orbun run cheshi-cli codegraph ...from an unlinked checkout. Usebun run desktop:devfor local development.
CodeGraph workflow
Cheshi stores CodeGraph indexes outside source repositories under its user-data
directory. Do not use a repository-local .codegraph/ directory as the index
status signal. Check the current Workspace with
cheshi-cli codegraph status /absolute/path/to/workspace --json; when it reports
initialized: true, use CodeGraph before rg, find, or manually reading
implementation files. Prefer the codegraph_explore MCP tool when available;
otherwise use the repository CLI path documented in the guide.
Before using CodeGraph or the desktop app, read
.docs/codegraph/guide.md once for the current task.
Check command options against CLI help and script names against package.json
when a documented command is unavailable.
- If status reports
initialized: false, use ordinary source inspection. Creating an index is the user's decision. - If status or queries fail, or CodeGraph is unavailable, briefly report the limitation and continue with ordinary source inspection in the needed scope. A failed status check does not establish that the index is uninitialized. If results are stale or contradict current source, read the affected source directly and use it as the authority. These fallbacks do not authorize index creation, sync, rebuild, unlock, or removal.
- Query specific symbols or files and use the returned source and call paths. Read only uncovered or explicitly stale ranges directly; avoid repeating complete source reads merely to verify the tool's output.
- Git metadata, documentation, configuration, and the explicit file-length check below can be inspected directly without a CodeGraph query.
- Cheshi manages incremental synchronization of existing indexes before SESSION and Docker Homie tasks and CodeGraph queries. This automatic path is authorized; concurrent requests share the workspace writer and wait for completion. It may update the same-engine WAL index while the Viewer remains read-only.
- Keep viewer inspection read-only. Outside that managed path, do not initiate index creation, sync, rebuild, unlock, or removal without authorization, or run a writer against an index being viewed. CLI, MCP, and app storage must resolve to the same workspace index. Never co-index it with a different engine implementation.
- An explore response truncated by its output budget does not prove an indexing failure. Narrow the query or inspect the remaining source range.
Code conventions
Electron and Node TypeScript runtime compatibility
- Author TypeScript for the runtime that executes each file. Electron loads the
main process and its imported
.mtsservices directly using Node's strip-only TypeScript support; renderer and bundled preload transforms do not apply there. - In directly loaded modules, use erasable TypeScript syntax. Do not use
constructor parameter properties such as
constructor(private readonly options: Options). Declareprivate readonly options: Optionsas a class field and assignthis.options = optionsin the constructor instead. Avoid other constructs requiring TypeScript code generation, including enums and runtime namespaces. - Bun tests and
tsc --noEmitpassing do not establish native runtime compatibility. When adding or changing a directly loaded module, verify its imports with native Node in strip-only mode, without a transpiling loader or transform-types flag. For an import-safe service, use a command such asnode --input-type=module -e "await import('./desktop/lib/codex-chat-contexts.mts')". - Keep import checks free of app startup, provider requests, and other external side effects. For entrypoints that require Electron, validate through an appropriate runtime test. Add a native Node loading regression test when fixing a runtime syntax failure; checking only the entrypoint's syntax misses imported modules.
Asynchronous test assertions
- In Bun test files, do not use
await expect(promise).resolves...orawait expect(promise).rejects.... Bun's assertion typings can make the final matcher appear synchronous, causing TypeScript and JetBrains to reportTS80007. - For successful promises, await the promise itself and then assert its value:
expect(await operation).toEqual(expected). - For expected failures, use a small asynchronous helper that awaits the operation, fails if it resolves, and validates the rejected error. Reuse a local helper when a test file contains more than one such assertion.
- Do not suppress these warnings with inspection comments when the asynchronous control flow can be expressed clearly in code.
Clear platform API names
- Alias generic filesystem APIs when their bare names are ambiguous to an IDE
or reader. In particular, import
linkascreateHardLinkandsymlinkascreateSymbolicLink. - Extract repeated deferred-Promise or asynchronous gate setup into a named
helper such as
createDeferredinstead of duplicating the setup in tests.
Boundary validation and maintainability
- When interpreting an external value as true, require the actual literal
true; do not simplify these checks to general truthiness. Preserve the existing contract forfalseand invalid values. - When validation inside a recovery
try/catchmust fail by throwing, move the throw into a named assertion helper while preserving the original call position, recovery flow, andcatch/finallybehavior. This extraction rule applies to validation failures inside recovery blocks, not to everythrow. - Do not leave unused imports, types, functions, or methods in the codebase.
- Let TypeScript infer straightforward React component return types; do not add
JSX.Elementannotations unless an explicit public type boundary requires one. - Do not silence Qodana, IDE, linter, compiler, or static-analysis findings with suppression comments. Fix the underlying code or make the usage statically discoverable instead.
- Extract repeated validation or comparison logic into a shared helper or an explicit field-name constant.
- When a test double intentionally returns malformed data, explicitly type its parameters and keep any unsafe cast confined to the injected boundary.
Verification
- For code changes, run the directly affected regression tests and relevant typechecks. Add tests for meaningful behavior or boundary cases, not assertions that merely copy a reversible style or implementation change.
Choose commands from the current root scripts:
Changed area Relevant typecheck Renderer TypeScript / React bun run viewer:typecheckElectron, desktop services, configuration, scripts bun run desktop:typecheckCodeGraph HTTP API ( desktop/backend/codegraph-server/)bun run desktop:typecheckDesktop tests and their imported modules bun run codegraph:server:typecheckPublic CLI bun run cli:typecheckCodeGraph engine and its tests bun run codegraph:typecheck- Use
bun test <test-file>for Bun suites. Retainnode --test <test-file>for suites that the existingdesktop:testscript runs under Node. - Validate renderer or CSS bundling with
bun run viewer:buildwhen affected. For packaging changes, verify the runtime includes new modules and their transitive imports. Run packaging checks when that boundary changes. - For documentation-only changes, verify referenced paths, commands, links, and
git diff --check; application tests and builds are unnecessary. - After checks pass, repeat or expand them only for a new edit, failure, unresolved concern, or explicit user request.
- When a test or validation command fails with evidence of sandbox or permission restrictions, first rerun the affected check in an approved environment with the required permissions, using authorized escalation when needed. Examples include denied loopback or Unix socket access, filesystem access, file watching, and credential-store access. Do not change application code, weaken assertions, or skip tests merely to make a restricted-environment failure pass.
- Investigate a product or test defect only if the failure persists with the required permissions or independent evidence establishes a defect. If an authorized rerun is unavailable or rejected, report the original failure and the verification limitation; do not claim a product failure or a passing check without evidence. Report environment failures and authorized rerun results separately from product failures.
- A build or typecheck does not establish rendered UI correctness. State which checks actually ran; use Computer Use only as described below.
Before ending a turn: changed-file length check
This is a coding-agent check performed before the final response. It does not install an application event handler or a runtime Stop hook.
- At the start of editing, note the existing worktree changes. Maintain an explicit set of files created, edited, or renamed during this turn, including changes made through shell commands and any authorized delegated work.
- After the final edit, formatter, and relevant checks, inspect only those paths
in their current on-disk state. Include new untracked files and previously
dirty files if this turn also edited them. A whole-worktree
git difforgit statuslist alone is not evidence of this turn's ownership. - Count physical lines in each remaining authored text file, including source, tests, styles, configuration, and documentation. Treat LF, CRLF, and CR as line endings; a final line ending does not add an extra empty line. Empty files have zero lines. Flag files with more than 1,000 lines.
- Skip deleted files, binaries, generated output, dependencies, lockfiles, and generated parser/vendor sources. Identify any relevant exclusion or read failure rather than counting an unread file as passing.
- Report the number of checked files and any exceeding paths with exact line counts. If this turn changed no files, omit the check. Do not scan the entire repository unless the user requests a repository-wide audit.
- Keep authored modules within 1,000 lines when implementing or refactoring within the authorized scope. A small, focused change to a file already exceeding 1,000 lines does not require splitting the entire file. Complete and validate that change, report the current line count, and recommend a focused split. Perform the split only when it is within the authorized scope; do not expand the task merely to meet the target. Preserve behavior, imports, and tests. Do not compress formatting or remove useful documentation just to reduce the count.
The 1,000-line guideline is a maintainability target, not a CodeGraph indexing or response-size limit. Preserve the turn's path set through context compaction.
UI design defaults
For desktop UI work, also read desktop/AGENTS.md for detailed rules for shared controls, tabs, badges, and panels, including intentional exceptions to the defaults below.
- Use
12pxas the default UI font size. Set larger or smaller sizes explicitly for titles, headers, and other intentional typography. - Use
16pxas the default spacing value forgap,padding,margin, and related layout spacing. Prefer the--space-defaulttoken for generic spacing, while preserving intentional structural offsets and reset values. - Use
15px × 15pxas the default SVG icon size through--icon-size-default. Override it only for intentional brand or decorative icon treatments. - Use
--icon-defaultfor adjacent icon-only controls; its current value indesktop/frontend/src/styles.cssis8px. Use--sidebar-widthfor shared side panels; its current value is320px. Reuse tokens rather than duplicating feature-specific widths or gaps. - Use icons from the official Lucide icon set.
In the frontend, prefer the corresponding
lucide-reactcomponent when it is available.
Shared controls and panels
- Use the shared
LiquidGlassPanelexported fromdesktop/frontend/src/shared/uifor reusable panel wrappers. Select the semantic wrapper with itsasprop and keep feature-specific sizing and layout in the consumer's class. - Read
LiquidGlassPanel.module.cssand the relevant shared control styles before changing their appearance. Use properties those components actually implement. Do not infer an alpha, shadow, gradient, or surface color from a component's historical name or reintroduce obsolete visual effects. - Keep shared borders, radii, and backdrop effects in the shared component.
For a flush sidebar wrapper, use its existing
--liquid-glass-radius: 0. - Match existing inputs and controls across normal, hover, focus, and disabled states. Enabled buttons and clickable cards use a pointer cursor; editable fields retain a text cursor. Match surrounding row height, typography, and icon treatment when adding a diagnostic or message.
- Apply visual changes only within the requested scope; preserve intentional theme differences and existing exceptions to the default typography.
Computer Use with Electron
- For authorized development-app interaction checks, prefer desktop-ui-check: its reusable Inspector/CDP runner reads rendered state and sends input to this checkout's running app. Requests such as "개발앱에서 확인해줘" select this workflow within the requested scope. Read the linked skill directly if it is not in the session catalog. Use screenshots or Computer Use as needed for visual appearance; DOM assertions alone do not establish visual correctness. The authorization and app-targeting rules below also apply to this runner.
- The user owns rendered UI review. Do not launch, screenshot, or control the app for visual verification unless the user explicitly delegates it. Requests to launch the app and check its screen, verify rendered layout or interactions, or use Computer Use for review count as delegation for the requested scope; do not ask for the same authorization again. A general request to run tests or "check everything" counts only when the conversation clearly includes rendered UI review in that scope. Otherwise, run the applicable automated checks and state that rendered UI was not reviewed. Supplied screenshots may be inspected without opening the app.
- When controlling Cheshi through Computer Use, never target the app with the
generic name
Electronor the shared bundle identifiercom.github.Electron. Multiple project checkouts can use that identity, and Computer Use may launch the wrong checkout's default Electron window. - Treat app-selection and state-reading APIs as potentially launching a target. Do not probe candidate Electron application paths with them merely to discover which one is Cheshi.
- First inspect the already-running processes and resolve the exact
Electron.apppath belonging to the current Cheshi checkout. Pass only that exact path to Computer Use. If Cheshi is not running, start it withbun run desktop:devbefore resolving the path. - Do not open or control an Electron binary from another project unless the user explicitly places that project in scope. Keep one Cheshi application window open during verification.
- Open DevTools only when it is needed for diagnosis, and close it afterward. Preserve unsaved editor content and leave unrelated applications alone.
Git commits and pushes
- Create a Git commit only when the user explicitly requests a commit.
- Push to a remote only when the user explicitly requests a push.
- Editing, building, testing, or completing a task does not implicitly authorize a commit or push.
- Use the requested/current branch and its configured remote; do not assume
main. A completed commit/push request does not authorize future changes. - Commit messages must use a lowercase flag in square brackets followed by a concise imperative summary in lowercase English.
- Numbers and the punctuation
.,-,_,/,#, and:are allowed in the summary when needed for versions, issue references, and technical names or paths. Do not use uppercase letters or Korean in commit messages. - Use the format:
[flag] summary. - Appropriate flags include
[init],[feature],[fix],[refactor],[docs],[test],[build], and[chore].
Example:
git commit -m "[init] set up project"Git worktree workflow
- Worktree directories must be created as siblings of the main repository.
- Use the path format
../<project>-<branch-slug>. - Worktree branch names must use one of these prefixes:
worktree/feature/<name>,worktree/fix/<name>, orworktree/experiment/<name>. - Use the user's specified base branch or commit for a new worktree. For a
continuation of existing work, use the base established by the conversation.
Default to
mainfor new independent work when no base has been specified. Resolve and verify the chosen base before creating the worktree; ask only if ambiguity would materially change which work is included. - Create the worktree with the chosen base substituted for
<base>:git worktree add -b worktree/<type>/<name> ../<project>-<branch-slug> <base> - Check existing worktrees with
git worktree listbefore creating one. - Never remove a worktree with uncommitted changes without explicit approval.
- Remove completed worktrees with:
git worktree remove ../<project>-<branch-slug> - Run
git worktree pruneonly to clean stale worktree metadata.
GitHub authentication checks
- Direct pushes use Git's authentication. Do not run
gh auth statusas a prerequisite for an ordinary commit/push to an existing remote. - Use
gh auth statusonly for GitHub CLI/API work or to diagnose its failure. - A sandbox or credential-store access failure does not establish invalid or
expired credentials. Verify with an authorized method before diagnosing
authentication. Use
gh api user --jq .loginwhen stronger evidence is needed. If verification is unavailable, report that limitation. - Git and
ghsuccess or failure do not establish each other's authentication state. Never rungh auth tokenor print a plaintext credential.
Safety
- Resolve exact targets before deleting or overwriting files.
- Prefer recoverable operations where practical.
- Do not use broad recursive destructive commands against the project root, the home directory, or unresolved paths.
Pre-commit and pre-push checks
- Before every commit, inspect the staged file list and staged diff to confirm that only files belonging to the requested change are included.
- Before committing, scan the staged changes for API keys, tokens, passwords, private keys, credentials, and authentication files. Before pushing, verify the outgoing commits contain only the reviewed and scanned changes; an empty staging area alone is not a pre-push scan.
- Check that generated build outputs, logs, temporary files, local databases, credential stores, and machine-specific files are not included unless the user explicitly requested them.
- If an unnecessary file or possible secret is found, stop the commit or push until it has been removed or the user has explicitly confirmed that it is safe and intended.
- Never print a complete secret while scanning or reporting findings. Report only the affected file, location, and secret category, with the value redacted.
- After pushing, confirm the upstream is synchronized and report any remaining worktree changes. Do not remove unrelated changes to obtain a clean status.
Maintaining these instructions
Keep repository-specific commands and constraints here; link detailed workflows instead of copying them. Verify current code before updating a rule that embeds a path, design token, or runtime assumption.
Reviewed against Astra prompting guidance and Codex instruction discovery. These links are maintenance references, not required reading for every task.
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.

