Skip to content

Commit b4d856c

Browse files
lemtoccodex
andcommitted
docs(codex): simplify commit and PR instructions
- remove Claude Code-specific AskUserQuestion guidance - replace commit and PR skills with compact Codex workflows - ignore local .codex directories in global git excludes Co-authored-by: Codex <codex@openai.com>
1 parent 46524ae commit b4d856c

4 files changed

Lines changed: 79 additions & 211 deletions

File tree

home/codex/AGENTS.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
- When specifications are ambiguous or information is insufficient and requires user judgment, use the `AskUserQuestion Tool`.
21
- Always resolve any type errors and linting errors displayed in the console.
32
- Avoid using `any`.
43
- Minimize the use of type casting with `as`.

home/codex/skills/commit/SKILL.md

Lines changed: 35 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -3,83 +3,38 @@ name: commit
33
description: Create a git commit following the Conventional Commits specification. Use when the user wants to commit staged changes, create a commit message, or run git commit. Handles commit message language detection (English/Japanese) based on recent commits.
44
---
55

6-
## Context
7-
8-
- Current git status: !`git status`
9-
- Staged changes: !`git diff --staged`
10-
- Recent commits (for language detection): !`git log -n 10 --pretty=format:"%s"`
11-
- Current branch: !`git branch --show-current`
12-
13-
## Your Task
14-
15-
Based on the above context:
16-
17-
1. Analyze the staged changes for any critical issues:
18-
- Review the **Staged changes** from context above
19-
- Check for sensitive information (passwords, API keys, etc.)
20-
- Verify that the changes are complete and coherent
21-
- If issues are found, confirm with the user before proceeding
22-
23-
2. Determine the commit message language:
24-
- Based on the **Recent commits** from context above
25-
- If the majority are in English, write in English
26-
- If the majority are in Japanese, write in Japanese
27-
- If `$ARGUMENTS` includes a language instruction, follow that instead
28-
29-
3. Create and execute the commit:
30-
- Refer to the **Commit Message Guidelines** section below when writing the message
31-
- Use `git commit -m` with an appropriate message
32-
33-
4. Verify the commit was successful:
34-
- Execute `git status` to verify the commit was successful
35-
- Provide a summary of what was committed to the user
36-
37-
## Commit Message Guidelines
38-
39-
- Follow the [Conventional Commits](https://www.conventionalcommits.org/) specification:
40-
- Format: `<type>(optional scope): <description>`
41-
- Example: `feat(auth): add OAuth2 login support`
42-
- **Allowed types**: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `chore`
43-
- Use the **imperative mood** in the description (e.g., "add", not "added" or "adds").
44-
- Keep the **summary concise** (max ~72 characters).
45-
- **Body rules**:
46-
- **Always include a body — no exceptions**, even for trivial-looking changes
47-
- Insert one blank line after the summary, then write the body
48-
- The body **must** be written as bullet points — **never** use prose paragraphs or a single free-form line
49-
- Each bullet should describe a reason, context, or detail of the change
50-
- Example:
51-
52-
```
53-
feat(auth): add OAuth2 login support
54-
55-
- implement login with OAuth2
56-
- update user model with providerId
57-
- add tests for OAuth2 flow
58-
```
59-
60-
- **Language rule**:
61-
- Use the same language as the majority of recent commits
62-
- If `$ARGUMENTS` includes a language instruction, follow that instead
63-
- **Scope language matches the message language**: for Japanese commits, the scope may also be written in Japanese (e.g., `feat(認証): OAuth2 ログインを追加`). For English commits, keep the scope in English.
64-
- **Focus rule**:
65-
- Do **not** write vague phrases like "fixed review comments", or "minor fix".
66-
- Always describe **what was actually changed** (e.g., "remove unused import", "fix null check in auth flow").
67-
- **Arguments rule**:
68-
- Treat `$ARGUMENTS` as additional context or instruction for the commit message
69-
70-
## HEREDOC Handling for Commit Messages
71-
72-
When composing a multi-line commit message with `git commit -m "$(cat <<...EOF ... EOF)"`, the HEREDOC quoting style affects how backticks are interpreted:
73-
74-
- **Single-quoted HEREDOC (`<<'EOF'`)**: No shell expansion happens, so write raw backticks directly (e.g., inline `` `functionName` `` or `` `file.ts` `` is safe)
75-
- **Double-quoted or unquoted HEREDOC (`<<"EOF"` / `<<EOF`)**: Bash may interpret backticks as command substitution. Avoid inline single backticks — use triple-backtick fenced blocks (```` ``` ````) if a code span is needed
76-
77-
**Rationale**: In double-quoted/unquoted HEREDOC, backticks sometimes get auto-escaped as `` \` ``, which leaks literal backslashes into the commit message.
78-
79-
**Recommendation**: Prefer `<<'EOF'` whenever the commit message contains backticks or code identifiers — it is the safest default.
80-
81-
## Important Notes
82-
83-
- Do not execute `git add`
84-
- The changes are already staged with the correct granularity and responsibility.
85-
- Do not execute `git push`
6+
## Commit Workflow
7+
8+
1. Inspect the repository state before committing:
9+
- `git status --short`
10+
- `git diff --staged`
11+
- `git log -n 10 --pretty=format:%s`
12+
- `git branch --show-current`
13+
2. Commit only staged changes. Do not run `git add` unless the user explicitly asks.
14+
3. If unstaged changes exist, leave them untouched and mention them after the commit.
15+
4. Check staged changes for secrets, broken partial edits, or obviously wrong files. If found, stop and ask the user.
16+
5. Choose the commit message language from recent commits unless the user specifies one.
17+
6. Run `git commit` and verify with `git status --short`.
18+
19+
## Commit Message
20+
21+
- Use Conventional Commits: `<type>(scope): <description>`.
22+
- Allowed types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `chore`.
23+
- Keep the summary imperative and under about 72 characters.
24+
- Use the same language as the majority of recent commits unless the user specifies one.
25+
- For Japanese commit messages, the scope may also be Japanese, e.g. `feat(認証): OAuth2 ログインを追加`.
26+
- Always include a body.
27+
- Write the body as bullet points.
28+
- Do not insert blank lines between bullet points.
29+
- Be specific about what changed. Avoid vague wording like "minor fix" or "review comments".
30+
- Add this trailer at the end of every commit message:
31+
32+
```text
33+
Co-authored-by: Codex <codex@openai.com>
34+
```
35+
36+
## Command Notes
37+
38+
- Prefer a single commit message body string or a message file so bullet points stay contiguous.
39+
- If using heredoc, use single-quoted heredoc (`<<'EOF'`) when the message contains backticks.
40+
- Do not push.

home/codex/skills/create-pr/SKILL.md

Lines changed: 43 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -3,155 +3,68 @@ name: create-pr
33
description: Create a GitHub pull request using the gh CLI. Use when the user wants to create a PR, submit changes for review, push and open a pull request on GitHub, or share a branch with collaborators. Handles PR title/body language detection (English/Japanese) and uses repository PR templates when available.
44
---
55

6-
## Context
7-
8-
- Current repository state: !`git status -sb`
9-
- Current branch details: !`git branch -vv`
10-
- Default branch: !`gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name'`
11-
- PR template (if exists): !`gh repo view --json pullRequestTemplates --jq '.pullRequestTemplates[0].body' 2>/dev/null || echo ""`
12-
- Recent commits (for language detection): !`git log -n 10 --pretty=format:"%s"`
13-
14-
## Your Task
15-
16-
Based on the above context:
17-
18-
1. Check changes and commits to be included:
19-
- Use the **Default branch** value from context above (obtained from `gh repo view`)
20-
- Execute `git diff origin/<default_branch>..HEAD --stat` to see the changes that will be included
21-
- Execute `git log origin/<default_branch>..HEAD --oneline` to see the commits that will be included
22-
- Review these changes and commits to confirm PR contents
23-
24-
2. Verify prerequisites:
25-
- Review the **Current repository state** and **Current branch details** from context above
26-
- Ensure all changes are committed (no unstaged/uncommitted changes)
27-
- Confirm the branch is appropriate for creating a PR
28-
- If issues are found, notify the user before proceeding
29-
30-
3. Push the branch to remote:
31-
- Execute `git push -u origin HEAD` to ensure the branch is available on GitHub
32-
- This is safe to run even if already pushed
33-
34-
4. Determine the PR language:
35-
- Based on the **Recent commits** from context above
36-
- If the majority are in English, write in English
37-
- If the majority are in Japanese, write in Japanese
38-
- If `$ARGUMENTS` includes a language instruction, follow that instead
39-
40-
5. Create the pull request:
41-
- Review the **PR template** from context above (if exists)
42-
- Use the repository's PR template if one was found
43-
- Otherwise, use the **Default PR Template** section below
44-
- Execute `gh pr create` with appropriate title and body
45-
- Refer to the **Pull Request Guidelines** section when composing
46-
47-
6. Finalize:
48-
- Execute `gh pr view --web` to open the PR in the browser
49-
- Provide the PR URL and summary to the user
6+
## Pull Request Workflow
7+
8+
1. Inspect the repository state before creating a PR:
9+
- `git status -sb`
10+
- `git branch -vv`
11+
- `gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name'`
12+
- `gh repo view --json pullRequestTemplates --jq '.pullRequestTemplates[0].body' 2>/dev/null || echo ""`
13+
- `git log -n 10 --pretty=format:%s`
14+
2. Use the default branch from `gh repo view`.
15+
3. Review the PR contents:
16+
- `git diff origin/<default_branch>..HEAD --stat`
17+
- `git log origin/<default_branch>..HEAD --oneline`
18+
4. Ensure all intended changes are committed before creating the PR.
19+
5. If there are unstaged or uncommitted changes, stop and ask the user unless they explicitly said a draft/WIP PR is acceptable with local changes left out.
20+
6. Push the current branch with `git push -u origin HEAD`.
21+
7. Create the PR with `gh pr create`.
22+
8. After creating the PR, report the PR URL and a short summary.
23+
9. Do not merge the PR unless explicitly instructed.
24+
25+
## Pull Request Content
26+
27+
- Use the repository PR template if one exists.
28+
- If no repository template exists, use the default template below.
29+
- Use the same language as the majority of recent commits unless the user specifies one.
30+
- Make the title concise and descriptive, about 72 characters or less.
31+
- Use a Conventional Commit-style title when it fits: `<type>(scope): <description>`.
32+
- For Japanese PR titles, the scope may also be Japanese, e.g. `feat(認証): OAuth2 ログイン機能を追加`.
33+
- Treat user-provided arguments as additional context for the title and body.
34+
- Keep bullet lists compact. Do not insert blank lines between bullet points.
35+
- Write sections equivalent to Changes (e.g. `変更内容`, `変更したこと`) and Verification (e.g. `確認したこと`) at a level a PM can read and understand.
36+
- Do not overload PR readers with excessive detail; keep these sections short and high-signal.
37+
- In verification/checklist sections, do not list CI-only checks such as lint, typecheck, or tests unless the reviewer must manually verify them.
38+
- Keep verification items unchecked and phrased as reviewer acceptance criteria.
39+
- Include implementation notes only when they help reviewers understand the approach or trade-offs.
40+
- Include this comment at the top of the PR body unless the user asks otherwise:
5041

51-
## Default PR Template
42+
```markdown
43+
<!-- Instructions for GitHub Copilot Code Review: Please provide your comments and review this pull request in Japanese. -->
44+
```
5245

53-
Use this template when no repository-specific template is found:
46+
## Default PR Template
5447

5548
```markdown
5649
<!-- Instructions for GitHub Copilot Code Review: Please provide your comments and review this pull request in Japanese. -->
5750

5851
## Issue
5952

60-
<!--
61-
If there's a related issue: fixes #123
62-
If no related issue: N/A - Brief description of the purpose
63-
Examples:
64-
- fixes #42
65-
- N/A - Add TypeScript configuration
66-
- N/A - Update dependencies
67-
-->
68-
6953
N/A - [brief description of the purpose]
7054

7155
## Changes
7256

73-
<!--
74-
List the main changes made in this PR using bullet points
75-
Examples:
76-
- Add user authentication feature
77-
- Fix memory leak in data processing
78-
- Update React from v17 to v18
79-
-->
80-
8157
- [Describe the main changes made]
8258

8359
## Verification
8460

85-
<!--
86-
Do NOT list items already verified by CI (tests, lint, type checks, etc.).
87-
List manual verification steps that reviewers should actually confirm.
88-
These should serve as acceptance criteria — if all are met, the PR can be approved.
89-
-->
90-
9161
- [ ] [Describe the expected behavior or manual verification step]
9262

9363
## Additional Notes
94-
95-
<!-- Any additional context, implementation details, or notes for reviewers -->
9664
```
9765

98-
## Pull Request Guidelines
99-
100-
- **Title format**:
101-
- Follow the same convention as commit messages if applicable
102-
- Be descriptive but concise (max ~72 characters)
103-
- **Scope language matches the title language**: for Japanese PRs the scope may be written in Japanese; for English PRs keep the scope in English
104-
- Example (English): `feat(auth): Add user authentication with OAuth2`
105-
- Example (Japanese): `feat(認証): OAuth2 ログイン機能を追加`
106-
107-
- **Issue section**:
108-
- Use `fixes #<number>` to automatically close related issues
109-
- Use `N/A - <description>` if no related issue exists
110-
- Provide brief context when there's no issue number
111-
112-
- **Changes section**:
113-
- List all significant changes in bullet points
114-
- Group related changes together
115-
- Be specific about what was modified, added, or removed
116-
117-
- **Verification section**:
118-
- Do not list items already verified by CI (tests, lint, type checks, etc.)
119-
- List manual verification steps that reviewers should actually confirm
120-
- All items should serve as acceptance criteria — if met, the PR can be approved
121-
- Keep checkboxes unchecked (`- [ ]`)
122-
123-
- **Additional Notes section**:
124-
- Include implementation details for complex changes
125-
- Add context that helps reviewers understand the approach
126-
- Mention any trade-offs or alternatives considered
127-
128-
- **Verification in repository templates**:
129-
- If the repository's PR template has a verification/confirmation section (e.g., "確認したこと", "Verification", "Checklist"), apply the same rules as the Verification section above
130-
- Do not list CI-verified items — only include manual verification steps reviewers should confirm
131-
132-
- **Language rule**:
133-
- Use the same language as the majority of recent commits
134-
- If `$ARGUMENTS` includes a language instruction, follow that instead
135-
136-
- **Arguments rule**:
137-
- Treat `$ARGUMENTS` as additional context or instruction for the PR title/description
138-
139-
## HEREDOC Handling for PR Body
140-
141-
When composing the PR body with `gh pr create --body "$(cat <<...EOF ... EOF)"`, the HEREDOC quoting style affects how backticks are interpreted:
142-
143-
- **Single-quoted HEREDOC (`<<'EOF'`)**: No shell expansion happens, so write raw backticks directly (both inline `` ` `` and fenced ```` ``` ````)
144-
- **Double-quoted or unquoted HEREDOC (`<<"EOF"` / `<<EOF`)**: Bash may try to interpret backticks as command substitution. Avoid inline single backticks — use triple-backtick fenced code blocks (```` ``` ````) instead
145-
146-
**Rationale**: In double-quoted/unquoted HEREDOC, backticks sometimes get auto-escaped as `` \` ``, which breaks Markdown rendering on GitHub (the code block fails to display properly).
147-
148-
**Recommendation**: Prefer `<<'EOF'` whenever the PR body contains backticks, code identifiers, or code blocks — it is the safest default.
149-
150-
## Important Notes
66+
## Command Notes
15167

152-
- Always ensure all changes are committed before creating a PR
153-
- Do not force push unless absolutely necessary
154-
- If the PR template exists in the repository, always use it over the default
155-
- Check CI/CD status after creating the PR
156-
- Do not merge the PR unless explicitly instructed
157-
- The GitHub Copilot instruction comment helps ensure reviews are provided in the appropriate language
68+
- Prefer a single PR body file or single-quoted heredoc (`<<'EOF'`) so Markdown renders correctly and bullet lists stay contiguous.
69+
- Do not force push unless absolutely necessary.
70+
- Do not push unrelated local changes.

home/git.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"dist/"
3535
"*.swp"
3636
"**/.claude/settings.local.json"
37+
"**/.codex/"
3738
"**/CLAUDE.local.md"
3839
"**/.serena/"
3940
"**/.review/"

0 commit comments

Comments
 (0)