Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .agents/skills/quantmind-dev/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ Development workflow for contributing to the QuantMind codebase.
operation or public-network source.
4. When creating, updating, or triaging an issue or pull request, use the
canonical [repository label guidance](../../../contexts/dev/labels.md).
5. Pick exactly one workflow reference below; do not load the others.
5. Before writing or editing any GitHub body, follow the canonical
[GitHub writing style](../../../contexts/dev/github-writing.md), including
its no-hard-wrap rule.
6. Pick exactly one workflow reference below; do not load the others.

## Select Workflow

Expand Down
5 changes: 4 additions & 1 deletion .agents/skills/quantmind-dev/references/pull-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ batch input`, `docs(readme): update quick start`.

Written in English (external audiences read it: contributors, search
indexers, future maintainers). Follow `.github/PULL_REQUEST_TEMPLATE.md`
and make sure the body covers:
and the canonical
[GitHub writing style](../../../../contexts/dev/github-writing.md). Do not
hard-wrap body prose at 80 columns or another fixed width. Make sure the body
covers:

1. **What changed and why** — a short summary; link the design discussion
if one exists.
Expand Down
5 changes: 4 additions & 1 deletion .claude/skills/quantmind-dev/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ Development workflow for contributing to the QuantMind codebase.
operation or public-network source.
4. When creating, updating, or triaging an issue or pull request, use the
canonical [repository label guidance](../../../contexts/dev/labels.md).
5. Pick exactly one workflow reference below; do not load the others.
5. Before writing or editing any GitHub body, follow the canonical
[GitHub writing style](../../../contexts/dev/github-writing.md), including
its no-hard-wrap rule.
6. Pick exactly one workflow reference below; do not load the others.

## Select Workflow

Expand Down
5 changes: 4 additions & 1 deletion .claude/skills/quantmind-dev/references/pull-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ batch input`, `docs(readme): update quick start`.

Written in English (external audiences read it: contributors, search
indexers, future maintainers). Follow `.github/PULL_REQUEST_TEMPLATE.md`
and make sure the body covers:
and the canonical
[GitHub writing style](../../../../contexts/dev/github-writing.md). Do not
hard-wrap body prose at 80 columns or another fixed width. Make sure the body
covers:

1. **What changed and why** — a short summary; link the design discussion
if one exists.
Expand Down
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ labels: ['type: bug']
assignees: ''
---

<!-- github-prose-style: Keep each logical paragraph/list item on one physical line; do not hard-wrap at 80 columns. -->

## 🐛 Bug Description

<!-- A clear and concise description of what the bug is. -->
Expand Down
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ labels: ['type: feature']
assignees: ''
---

<!-- github-prose-style: Keep each logical paragraph/list item on one physical line; do not hard-wrap at 80 columns. -->

## ✨ Feature Summary

<!-- A clear and concise description of the feature you'd like to see implemented. -->
Expand Down
2 changes: 2 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<!-- github-prose-style: Keep each logical paragraph/list item on one physical line; do not hard-wrap at 80 columns. -->

## Summary

<!-- What changed and why? Keep this concise and link the design when useful. -->
Expand Down
3 changes: 3 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ A new feature ships with a unit test **and** a focused example:

- Commit messages: English, Conventional Commits.
- PR titles, PR bodies, and issue bodies: English.
- GitHub Issue, Pull Request, Discussion, and comment body formatting follows
the [GitHub writing style](contexts/dev/github-writing.md); never hard-wrap
remote prose at 80 columns or another fixed width.
- Code comments and docstrings: English, Google style.

## Development Workflows
Expand Down
3 changes: 3 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ A new feature ships with a unit test **and** a focused example:

- Commit messages: English, Conventional Commits.
- PR titles, PR bodies, and issue bodies: English.
- GitHub Issue, Pull Request, Discussion, and comment body formatting follows
the [GitHub writing style](contexts/dev/github-writing.md); never hard-wrap
remote prose at 80 columns or another fixed width.
- Code comments and docstrings: English, Google style.

## Development Workflows
Expand Down
1 change: 1 addition & 0 deletions contexts/dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ canonical source instead of treating this page as a replacement for it.
| Architecture constraints and module ownership | [`AGENTS.md`](../../AGENTS.md) or [`CLAUDE.md`](../../CLAUDE.md) |
| Component-development workflow | [`quantmind-dev` component workflow](../../.agents/skills/quantmind-dev/references/develop-components.md) |
| Issue and pull-request labels | [Repository label guidance](labels.md) |
| Issue and pull-request body formatting | [GitHub writing style](github-writing.md) |
| Public operation and source catalog | [`docs/README.md`](../../docs/README.md) |
| Public operation naming | [Operation naming contract](../../docs/design/en/operations.md) |
| Component designs | [`docs/design/`](../../docs/design/) |
Expand Down
46 changes: 46 additions & 0 deletions contexts/dev/github-writing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# GitHub Writing Style

This guide is the canonical source-format contract for QuantMind Issue, Pull
Request, Discussion, and comment bodies. It applies to text submitted to
GitHub, not to Markdown files stored in the repository.

## No Hard-wrapped Prose

GitHub wraps rendered prose for the viewer. Do not insert source newlines at a
fixed width, including 80 columns.

- Keep each logical paragraph on one physical source line.
- Keep each list or checklist item on one physical source line.
- Keep each blockquote paragraph on one physical source line after `>`.
- Keep each Markdown table row on one physical source line.
- Preserve line structure inside fenced code blocks.
- Use blank lines, headings, lists, code fences, tables, or an intentional
Markdown hard break only when they express real structure.

Repository formatters and code line-length settings do not apply to GitHub
body prose. In particular, do not run Issue or Pull Request bodies through
`textwrap.fill`, an 80-column editor wrap, or a Markdown formatter configured
to wrap prose.

## Write Workflow

1. Draft the complete body with one logical prose unit per source line.
2. Preserve the selected Issue or Pull Request template and its checklist.
3. Submit the body as written, preferably with `--body-file` when using `gh`.
4. Read the raw body back after creation or editing and check that prose was
not hard-wrapped before considering the write complete.

When Prettier is already available, use its no-wrap mode as a preflight on the
temporary body file:

```bash
prettier --write --parser markdown --prose-wrap never /tmp/github-body.md
prettier --check --parser markdown --prose-wrap never /tmp/github-body.md
```

Do not introduce a repository-wide Markdown formatter or change Python's
80-column setting for this purpose. The preflight applies only to the temporary
GitHub body.

When updating an existing hard-wrapped body, normalize the complete body while
preserving its meaning, headings, lists, code blocks, links, and checkboxes.
3 changes: 3 additions & 0 deletions contexts/dev/labels.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ type, area, and impact dimensions.

## Issues and Pull Requests

Body source formatting follows the [GitHub writing style](github-writing.md),
including its no-hard-wrap rule.

- Label an issue from the intended problem and accepted scope.
- Label a pull request from its actual diff.
- A pull request that closes an issue should normally align with the issue's
Expand Down
70 changes: 67 additions & 3 deletions tests/test_contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def test_context_index_targets_exist(self) -> None:
context_indexes = (
"contexts/README.md",
"contexts/dev/README.md",
"contexts/dev/github-writing.md",
"contexts/dev/labels.md",
"contexts/usage/README.md",
)
Expand Down Expand Up @@ -118,9 +119,72 @@ def test_label_guide_has_complete_taxonomy(self) -> None:
with self.subTest(dimension=dimension):
self.assertEqual(found, expected)

def test_github_writing_guide_has_required_routes(self) -> None:
repo_root = Path(__file__).resolve().parents[1]
required_links = {
"contexts/dev/README.md": "github-writing.md",
"contexts/dev/labels.md": "github-writing.md",
"AGENTS.md": "contexts/dev/github-writing.md",
"CLAUDE.md": "contexts/dev/github-writing.md",
".agents/skills/quantmind-dev/SKILL.md": (
"../../../contexts/dev/github-writing.md"
),
".claude/skills/quantmind-dev/SKILL.md": (
"../../../contexts/dev/github-writing.md"
),
".agents/skills/quantmind-dev/references/pull-request.md": (
"../../../../contexts/dev/github-writing.md"
),
".claude/skills/quantmind-dev/references/pull-request.md": (
"../../../../contexts/dev/github-writing.md"
),
}

for source_path, target in required_links.items():
source = repo_root / source_path
with self.subTest(source=source_path):
self.assertIn(
f"]({target})",
source.read_text(encoding="utf-8"),
f"{source_path} must route to the GitHub writing guide",
)
self.assertTrue(
(source.parent / target).resolve().is_file(),
f"broken GitHub writing guide link: {target}",
)

marker = "<!-- github-prose-style:"
templates = (
".github/ISSUE_TEMPLATE/bug_report.md",
".github/ISSUE_TEMPLATE/feature_request.md",
".github/PULL_REQUEST_TEMPLATE.md",
)
for template_path in templates:
with self.subTest(template=template_path):
template = repo_root / template_path
self.assertIn(
marker,
template.read_text(encoding="utf-8"),
f"{template_path} must remind authors not to hard-wrap",
)

def test_quantmind_dev_skill_mirrors_match(self) -> None:
repo_root = Path(__file__).resolve().parents[1]
agents_skill = repo_root / ".agents/skills/quantmind-dev/SKILL.md"
claude_skill = repo_root / ".claude/skills/quantmind-dev/SKILL.md"
mirror_paths = (
"SKILL.md",
"references/commit.md",
"references/develop-components.md",
"references/pull-request.md",
)

self.assertEqual(agents_skill.read_bytes(), claude_skill.read_bytes())
for relative_path in mirror_paths:
agents_skill = (
repo_root / ".agents/skills/quantmind-dev" / relative_path
)
claude_skill = (
repo_root / ".claude/skills/quantmind-dev" / relative_path
)
with self.subTest(path=relative_path):
self.assertEqual(
agents_skill.read_bytes(), claude_skill.read_bytes()
)
Loading