agentleFS
CheshiAICheshiAI/Cheshi/AGENTS.md

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.

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
  1. Distinctive:

    If the user has already explicitly approved the same concrete change, proceed within that scope without requesting the same approval again.

    line 16
  2. Distinctive:

    Read-only inspection, analysis, and relevant validation may proceed before code-change approval, subject to the existing permission and …

    line 18
  3. Distinctive:

    When actual work shows that a repository rule or user direction limits a better solution, proactively explain the specific constraint and a …

    line 33
  4. Distinctive:

    Ask a focused question when required approval is missing or missing information materially changes the scope or blocks correct execution.

    line 38
  5. Distinctive:

    If a rule or tool approval blocks work, identify the exact instruction or rejection and its source.

    line 41
  6. Distinctive:

    Treat corrections and status questions as part of the ongoing task.

    line 43
  7. Distinctive:

    Before saving project information, learned findings, or other content to persistent memory, tell the user what will be saved and where, ask …

    line 45
  8. Distinctive:

    Use judgment to decide when and how often to propose memory updates based on lasting usefulness, novelty, and relevance to future work.

    line 49
  9. Distinctive:

    Use parallel tool calls for independent reads and checks.

    line 53
  10. Distinctive:

    When delegation is requested, assign bounded tasks with clear file ownership, coordinate shared dependencies, and personally review the …

    line 56
  11. Distinctive:

    Use the user's requested language.

    line 60
  12. Distinctive:

    Prefer feature and service boundaries compatible with an MSA monorepo.

    line 75
  13. Very specific:

    Use Bun for dependency management and routine scripts.

    line 81
  14. Very specific:

    Use cheshi-cli codegraph ...

    line 83
  15. Very specific:

    Before using CodeGraph or the desktop app, read .docs/codegraph/guide.md once for the current task.

    line 96
  16. Very specific:

    Check command options against CLI help and script names against package.json when a documented command is unavailable.

    line 98
  17. Very specific:

    If status reports initialized: false, use ordinary source inspection.

    line 101
  18. Distinctive:

    If status or queries fail, or CodeGraph is unavailable, briefly report the limitation and continue with ordinary source inspection in the …

    line 103
  19. Distinctive:

    If results are stale or contradict current source, read the affected source directly and use it as the authority.

    line 106
  20. Distinctive:

    Read only uncovered or explicitly stale ranges directly.

    line 110
  21. Distinctive:

    Keep viewer inspection read-only.

    line 118
  22. Distinctive:

    Keep import checks free of app startup, provider requests, and other external side effects.

    line 143
  23. Distinctive:

    Do not suppress these warnings with inspection comments when the asynchronous control flow can be expressed clearly in code.

    line 161
  24. Very specific:

    When interpreting an external value as true, require the actual literal true.

    line 174
  25. Very specific:

    When validation inside a recovery try/catch must fail by throwing, move the throw into a named assertion helper while preserving the …

    line 177
  26. Distinctive:

    Do not leave unused imports, types, functions, or methods in the codebase.

    line 181
  27. Distinctive:

    Do not silence Qodana, IDE, linter, compiler, or static-analysis findings with suppression comments.

    line 185
  28. Distinctive:

    When a test double intentionally returns malformed data, explicitly type its parameters and keep any unsafe cast confined to the injected …

    line 190
  29. Very specific:

    Use bun test <test-file> for Bun suites.

    line 209
  30. Distinctive:

    After checks pass, repeat or expand them only for a new edit, failure, unresolved concern, or explicit user request.

    line 216
  31. Distinctive:

    When a test or validation command fails with evidence of sandbox or permission restrictions, first rerun the affected check in an approved …

    line 218
  32. Distinctive:

    After the final edit, formatter, and relevant checks, inspect only those paths in their current on-disk state.

    line 241
  33. Distinctive:

    Keep authored modules within 1,000 lines when implementing or refactoring within the authorized scope.

    line 255
  34. Distinctive:

    Do not compress formatting or remove useful documentation just to reduce the count.

    line 261
  35. Very specific:

    Use 12px as the default UI font size.

    line 273
  36. Very specific:

    Use 16px as the default spacing value for gap, padding, margin, and related layout spacing.

    line 275
  37. Very specific:

    Use 15px × 15px as the default SVG icon size through --icon-size-default.

    line 278
  38. Very specific:

    Use --icon-default for adjacent icon-only controls.

    line 281
  39. Very specific:

    Use icons from the official Lucide icon set.

    line 285
  40. Very specific:

    Use the shared LiquidGlassPanel exported from desktop/frontend/src/shared/ui for reusable panel wrappers.

    line 291
  41. Very specific:

    Read LiquidGlassPanel.module.css and the relevant shared control styles before changing their appearance.

    line 295
  42. Very specific:

    Keep shared borders, radii, and backdrop effects in the shared component.

    line 299
  43. Very specific:

    When controlling Cheshi through Computer Use, never target the app with the generic name Electron or the shared bundle identifier …

    line 327
  44. Very specific:

    Treat app-selection and state-reading APIs as potentially launching a target.

    line 331
  45. Very specific:

    Do not probe candidate Electron application paths with them merely to discover which one is Cheshi.

    line 332
  46. Very specific:

    Do not open or control an Electron binary from another project unless the user explicitly places that project in scope.

    line 338
  47. Distinctive:

    Create a Git commit only when the user explicitly requests a commit.

    line 346
  48. Distinctive:

    Use the requested/current branch and its configured remote.

    line 349
  49. Distinctive:

    Commit messages must use a lowercase flag in square brackets followed by a concise imperative summary in lowercase English.

    line 351
  50. Very specific:

    Use the format: [flag] summary.

    line 356
  51. Very specific:

    Use the path format ../<project>-<branch-slug>.

    line 368
  52. Distinctive:

    Use the user's specified base branch or commit for a new worktree.

    line 371
  53. Distinctive:

    Default to main for new independent work when no base has been specified.

    line 373
  54. Very specific:

    Create the worktree with the chosen base substituted for <base>: git worktree add -b worktree/<type>/<name> ../<project>-<branch-slug> …

    line 376
  55. Distinctive:

    Check existing worktrees with git worktree list before creating one.

    line 378
  56. Distinctive:

    Never remove a worktree with uncommitted changes without explicit approval.

    line 379
  57. Very specific:

    Remove completed worktrees with: git worktree remove ../<project>-<branch-slug>

    line 380
  58. Distinctive:

    Run git worktree prune only to clean stale worktree metadata.

    line 382
  59. Very specific:

    Use gh auth status only for GitHub CLI/API work or to diagnose its failure.

    line 388
  60. Distinctive:

    If verification is unavailable, report that limitation.

    line 392
  61. Distinctive:

    Prefer recoverable operations where practical.

    line 399
  62. Distinctive:

    Do not use broad recursive destructive commands against the project root, the home directory, or unresolved paths.

    line 400
  63. Distinctive:

    Before every commit, inspect the staged file list and staged diff to confirm that only files belonging to the requested change are included.

    line 404
  64. Common:

    Before committing, scan the staged changes for API keys, tokens, passwords, private keys, credentials, and authentication files.

    line 405
  65. Common:

    Check that generated build outputs, logs, temporary files, local databases, credential stores, and machine-specific files are not included …

    line 409
  66. Common:

    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 …

    line 410
  67. Common:

    Never print a complete secret while scanning or reporting findings.

    line 411
  68. Distinctive:

    After pushing, confirm the upstream is synchronized and report any remaining worktree changes.

    line 412
  69. Distinctive:

    Keep repository-specific commands and constraints here.

    line 417

≈ “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.

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

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 in desktop/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 .cts as appropriate. Edit source files rather than generated .js, .mjs, or .cjs artifacts.
  • Use Bun for dependency management and routine scripts. Check package.json for current command names; do not substitute npm or pnpm without a task reason.
  • Use cheshi-cli codegraph ... publicly, or bun run cheshi-cli codegraph ... from an unlinked checkout. Use bun run desktop:dev for 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 .mts services 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). Declare private readonly options: Options as a class field and assign this.options = options in the constructor instead. Avoid other constructs requiring TypeScript code generation, including enums and runtime namespaces.
  • Bun tests and tsc --noEmit passing 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 as node --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... or await expect(promise).rejects.... Bun's assertion typings can make the final matcher appear synchronous, causing TypeScript and JetBrains to report TS80007.
  • 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 link as createHardLink and symlink as createSymbolicLink.
  • Extract repeated deferred-Promise or asynchronous gate setup into a named helper such as createDeferred instead 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 for false and invalid values.
  • When validation inside a recovery try/catch must fail by throwing, move the throw into a named assertion helper while preserving the original call position, recovery flow, and catch/finally behavior. This extraction rule applies to validation failures inside recovery blocks, not to every throw.
  • Do not leave unused imports, types, functions, or methods in the codebase.
  • Let TypeScript infer straightforward React component return types; do not add JSX.Element annotations 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 areaRelevant typecheck
    Renderer TypeScript / Reactbun run viewer:typecheck
    Electron, desktop services, configuration, scriptsbun run desktop:typecheck
    CodeGraph HTTP API (desktop/backend/codegraph-server/)bun run desktop:typecheck
    Desktop tests and their imported modulesbun run codegraph:server:typecheck
    Public CLIbun run cli:typecheck
    CodeGraph engine and its testsbun run codegraph:typecheck
  • Use bun test <test-file> for Bun suites. Retain node --test <test-file> for suites that the existing desktop:test script runs under Node.
  • Validate renderer or CSS bundling with bun run viewer:build when 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.

  1. 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.
  2. 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 diff or git status list alone is not evidence of this turn's ownership.
  3. 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.
  4. 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.
  5. 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.
  6. 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 12px as the default UI font size. Set larger or smaller sizes explicitly for titles, headers, and other intentional typography.
  • Use 16px as the default spacing value for gap, padding, margin, and related layout spacing. Prefer the --space-default token for generic spacing, while preserving intentional structural offsets and reset values.
  • Use 15px × 15px as the default SVG icon size through --icon-size-default. Override it only for intentional brand or decorative icon treatments.
  • Use --icon-default for adjacent icon-only controls; its current value in desktop/frontend/src/styles.css is 8px. Use --sidebar-width for shared side panels; its current value is 320px. 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-react component when it is available.

Shared controls and panels

  • Use the shared LiquidGlassPanel exported from desktop/frontend/src/shared/ui for reusable panel wrappers. Select the semantic wrapper with its as prop and keep feature-specific sizing and layout in the consumer's class.
  • Read LiquidGlassPanel.module.css and 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 Electron or the shared bundle identifier com.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.app path belonging to the current Cheshi checkout. Pass only that exact path to Computer Use. If Cheshi is not running, start it with bun run desktop:dev before 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>, or worktree/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 main for 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 list before 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 prune only to clean stale worktree metadata.

GitHub authentication checks

  • Direct pushes use Git's authentication. Do not run gh auth status as a prerequisite for an ordinary commit/push to an existing remote.
  • Use gh auth status only 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 .login when stronger evidence is needed. If verification is unavailable, report that limitation.
  • Git and gh success or failure do not establish each other's authentication state. Never run gh auth token or 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.

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.