ace-handbook 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.ace-defaults/handbook/config.yml +4 -0
- data/.ace-defaults/nav/protocols/guide-sources/ace-handbook.yml +19 -0
- data/.ace-defaults/nav/protocols/tmpl-sources/ace-handbook.yml +10 -0
- data/.ace-defaults/nav/protocols/wfi-sources/ace-handbook.yml +19 -0
- data/CHANGELOG.md +362 -0
- data/LICENSE +21 -0
- data/README.md +42 -0
- data/Rakefile +12 -0
- data/exe/ace-handbook +6 -0
- data/handbook/guides/ai-agent-integration.g.md +625 -0
- data/handbook/guides/atom-pattern.g.md +371 -0
- data/handbook/guides/changelog.g.md +333 -0
- data/handbook/guides/cli-dry-cli.g.md +276 -0
- data/handbook/guides/cli-support-cli.g.md +277 -0
- data/handbook/guides/coding-standards/ruby.md +41 -0
- data/handbook/guides/coding-standards/rust.md +19 -0
- data/handbook/guides/coding-standards/typescript.md +20 -0
- data/handbook/guides/coding-standards.g.md +134 -0
- data/handbook/guides/debug-troubleshooting.g.md +62 -0
- data/handbook/guides/error-handling/ruby.md +29 -0
- data/handbook/guides/error-handling/rust.md +59 -0
- data/handbook/guides/error-handling/typescript.md +38 -0
- data/handbook/guides/error-handling.g.md +207 -0
- data/handbook/guides/meta/agents-definition.g.md +823 -0
- data/handbook/guides/meta/guides-definition.g.md +322 -0
- data/handbook/guides/meta/markdown-definition.g.md +210 -0
- data/handbook/guides/meta/tools-definition.g.md +159 -0
- data/handbook/guides/meta/workflow-instructions-definition.g.md +367 -0
- data/handbook/guides/mono-repo-patterns.g.md +92 -0
- data/handbook/guides/multi-agent-research.g.md +251 -0
- data/handbook/guides/performance/ruby.md +25 -0
- data/handbook/guides/performance/rust.md +48 -0
- data/handbook/guides/performance/typescript.md +32 -0
- data/handbook/guides/performance.g.md +211 -0
- data/handbook/guides/prompt-caching.g.md +83 -0
- data/handbook/guides/quality-assurance/ruby.md +33 -0
- data/handbook/guides/quality-assurance/rust.md +41 -0
- data/handbook/guides/quality-assurance/typescript.md +49 -0
- data/handbook/guides/quality-assurance.g.md +222 -0
- data/handbook/guides/strategic-planning.g.md +69 -0
- data/handbook/guides/troubleshooting/ruby.md +21 -0
- data/handbook/guides/troubleshooting/rust.md +20 -0
- data/handbook/guides/troubleshooting/typescript.md +36 -0
- data/handbook/guides/workflow-context-embedding.g.md +286 -0
- data/handbook/skills/as-handbook-init-project/SKILL.md +34 -0
- data/handbook/skills/as-handbook-manage-agents/SKILL.md +35 -0
- data/handbook/skills/as-handbook-manage-guides/SKILL.md +35 -0
- data/handbook/skills/as-handbook-manage-workflows/SKILL.md +35 -0
- data/handbook/skills/as-handbook-parallel-research/SKILL.md +29 -0
- data/handbook/skills/as-handbook-perform-delivery/SKILL.md +35 -0
- data/handbook/skills/as-handbook-review-guides/SKILL.md +32 -0
- data/handbook/skills/as-handbook-review-workflows/SKILL.md +32 -0
- data/handbook/skills/as-handbook-synthesize-research/SKILL.md +29 -0
- data/handbook/skills/as-handbook-update-docs/SKILL.md +35 -0
- data/handbook/skills/as-release/SKILL.md +50 -0
- data/handbook/skills/as-release-bump-version/SKILL.md +28 -0
- data/handbook/skills/as-release-rubygems-publish/SKILL.md +58 -0
- data/handbook/skills/as-release-update-changelog/SKILL.md +28 -0
- data/handbook/templates/completed-work-documentation.md +59 -0
- data/handbook/templates/cookbooks/cookbook.template.md +237 -0
- data/handbook/templates/research-comparison.template.md +175 -0
- data/handbook/workflow-instructions/handbook/init-project.wf.md +629 -0
- data/handbook/workflow-instructions/handbook/manage-agents.wf.md +379 -0
- data/handbook/workflow-instructions/handbook/manage-guides.wf.md +294 -0
- data/handbook/workflow-instructions/handbook/manage-workflows.wf.md +292 -0
- data/handbook/workflow-instructions/handbook/parallel-research.wf.md +328 -0
- data/handbook/workflow-instructions/handbook/perform-delivery.wf.md +267 -0
- data/handbook/workflow-instructions/handbook/research.wf.md +247 -0
- data/handbook/workflow-instructions/handbook/review-guides.wf.md +348 -0
- data/handbook/workflow-instructions/handbook/review-workflows.wf.md +299 -0
- data/handbook/workflow-instructions/handbook/synthesize-research.wf.md +429 -0
- data/handbook/workflow-instructions/handbook/update-docs.wf.md +338 -0
- data/lib/ace/handbook/atoms/provider_registry.rb +70 -0
- data/lib/ace/handbook/cli/commands/status.rb +36 -0
- data/lib/ace/handbook/cli/commands/sync.rb +36 -0
- data/lib/ace/handbook/cli.rb +51 -0
- data/lib/ace/handbook/models/skill_document.rb +25 -0
- data/lib/ace/handbook/molecules/skill_projection.rb +54 -0
- data/lib/ace/handbook/organisms/provider_syncer.rb +106 -0
- data/lib/ace/handbook/organisms/skill_inventory.rb +54 -0
- data/lib/ace/handbook/organisms/status_collector.rb +181 -0
- data/lib/ace/handbook/version.rb +7 -0
- data/lib/ace/handbook.rb +28 -0
- metadata +227 -0
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
---
|
|
2
|
+
doc-type: guide
|
|
3
|
+
title: Writing Development Guides
|
|
4
|
+
purpose: Documentation for ace-handbook/handbook/guides/meta/guides-definition.g.md
|
|
5
|
+
ace-docs:
|
|
6
|
+
last-updated: 2026-02-22
|
|
7
|
+
last-checked: 2026-03-21
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Writing Development Guides
|
|
11
|
+
|
|
12
|
+
This guide outlines best practices for creating and maintaining the development guides located within the handbook guides directory. These guides serve as the primary reference for project standards, processes, and technical approaches, intended for both human developers and AI agents collaborating on the project.
|
|
13
|
+
|
|
14
|
+
## Goal of Guides
|
|
15
|
+
|
|
16
|
+
The primary goal of these guides is to:
|
|
17
|
+
- Document established standards, best practices, and workflows.
|
|
18
|
+
- Ensure consistency across the project.
|
|
19
|
+
- Provide clear, actionable instructions and explanations.
|
|
20
|
+
- Serve as a reliable knowledge base for both human developers and AI agents.
|
|
21
|
+
|
|
22
|
+
## Core Principles
|
|
23
|
+
|
|
24
|
+
1. **Conceptual Focus:** Guides explain the "Why" - principles, concepts, standards, and best practices. Workflows explain the "How" - step-by-step procedural instructions. Guides should focus on understanding and decision-making rather than execution.
|
|
25
|
+
2. **Clarity & Conciseness:** Write clearly and avoid ambiguity. Get straight to the point. Use simple language where possible.
|
|
26
|
+
3. **Accuracy & Up-to-Date:** Ensure information is correct and reflects the current project state and decisions. Update guides promptly when processes or standards change.
|
|
27
|
+
4. **Conceptual Actionability:** Provide practical advice, principles, and context that help readers understand what to do and why, while linking to self-contained workflows for specific execution steps.
|
|
28
|
+
5. **Structure & Scanability:** Use clear headings, subheadings, lists, and code blocks to organize information logically. Make it easy for readers (human or AI) to quickly find relevant sections.
|
|
29
|
+
6. **Consistency:** Use consistent terminology, formatting, and structure across all guides. Refer to terms defined in other guides or the main [Project Management Guide](guide://project-management).
|
|
30
|
+
7. **Examples:** Provide concrete examples (code snippets, file structures, command outputs) to illustrate concepts and principles, not step-by-step procedures.
|
|
31
|
+
8. **Target Audience:** Write for both human developers (potentially new to the project) and AI agents. This means being explicit, structured, and providing sufficient context.
|
|
32
|
+
9. **Language Modularity:** When a guide mixes language‑specific details with general advice, extract each language's specifics into a dedicated sub‑guide (e.g., `testing/ruby-rspec.md`, `security/rust.md`). Keep the parent guide language‑agnostic.
|
|
33
|
+
|
|
34
|
+
## File Naming Convention
|
|
35
|
+
|
|
36
|
+
All guide files must use the `.g.md` suffix to distinguish them from workflow instructions (which use `.wf.md`). This convention enables proper editor configuration and clear separation of content types.
|
|
37
|
+
|
|
38
|
+
### Naming Pattern
|
|
39
|
+
- **Format:** `<noun-phrase>.g.md`
|
|
40
|
+
- **Style:** Use noun-based naming that describes what the guide covers, avoiding action verbs
|
|
41
|
+
- **Examples:**
|
|
42
|
+
- `coding-standards.g.md` (not `write-coding-standards.g.md`)
|
|
43
|
+
- `testing-tdd-cycle.g.md` (not `implement-tdd-cycle.g.md`)
|
|
44
|
+
- `release-publish.g.md` (not `publish-release.g.md`)
|
|
45
|
+
- `debug-troubleshooting.g.md` (not `troubleshoot-issues.g.md`)
|
|
46
|
+
|
|
47
|
+
### Contrast with Workflow Instructions
|
|
48
|
+
Unlike workflow instructions (`.wf.md` files) which use verb-first naming to indicate actions:
|
|
49
|
+
- **Guides** document standards and knowledge: `security.g.md`, `performance.g.md`
|
|
50
|
+
- **Workflows** describe processes to execute: `commit.wf.md`, `fix-tests.wf.md`
|
|
51
|
+
|
|
52
|
+
This naming distinction helps both humans and AI agents quickly identify whether a file provides reference information (guide) or executable instructions (workflow).
|
|
53
|
+
|
|
54
|
+
## Content Guidelines: Guides vs Workflows
|
|
55
|
+
|
|
56
|
+
Guides and workflows serve distinct purposes and should contain different types of content. Understanding this separation is essential for maintaining consistency across the handbook system.
|
|
57
|
+
|
|
58
|
+
### What Belongs in Guides
|
|
59
|
+
|
|
60
|
+
**Conceptual Content:**
|
|
61
|
+
- Principles, philosophies, and best practices
|
|
62
|
+
- Standards and coding conventions
|
|
63
|
+
- Architecture patterns and design approaches
|
|
64
|
+
- Explanation of why certain approaches are preferred
|
|
65
|
+
- Context and rationale behind decisions
|
|
66
|
+
- Deep-dive knowledge and understanding
|
|
67
|
+
|
|
68
|
+
**Appropriate Guide Content Examples:**
|
|
69
|
+
- "Test-driven development principles and benefits"
|
|
70
|
+
- "Security considerations for input validation"
|
|
71
|
+
- "Code review standards and what to look for"
|
|
72
|
+
- "Performance optimization strategies"
|
|
73
|
+
- "Error handling patterns and when to use them"
|
|
74
|
+
|
|
75
|
+
### What Does NOT Belong in Guides
|
|
76
|
+
|
|
77
|
+
**Procedural Content:**
|
|
78
|
+
- Step-by-step instructions for executing tasks
|
|
79
|
+
- Command sequences and specific CLI operations
|
|
80
|
+
- Implementation workflows and task execution
|
|
81
|
+
- Interactive checklists meant to be completed
|
|
82
|
+
- Detailed "how-to" procedures
|
|
83
|
+
|
|
84
|
+
**Content That Should Be in Workflows Instead:**
|
|
85
|
+
- "How to set up test environment" → Move to workflow
|
|
86
|
+
- "Steps to perform security audit" → Move to workflow
|
|
87
|
+
- "Checklist for code review process" → Move to workflow
|
|
88
|
+
- "Commands to deploy application" → Move to workflow
|
|
89
|
+
|
|
90
|
+
### Linking Between Guides and Workflows
|
|
91
|
+
|
|
92
|
+
**From Guides to Workflows:**
|
|
93
|
+
- Guides should link to relevant workflows when discussing how principles are applied
|
|
94
|
+
- Use clear language: "To implement these security principles, see [Security Audit Workflow](wfi://security-audit)"
|
|
95
|
+
- Avoid embedding procedural steps directly in guides
|
|
96
|
+
|
|
97
|
+
**From Workflows to Guides:**
|
|
98
|
+
- Workflows can reference guides for context and rationale
|
|
99
|
+
- Link to guides when explaining why certain steps are necessary
|
|
100
|
+
- Use format: "For background on these testing principles, see [Testing Guide](guide://testing)"
|
|
101
|
+
|
|
102
|
+
## Standard Guide Structure
|
|
103
|
+
|
|
104
|
+
While the specific sections will vary based on the guide's topic, aim for a general structure like this:
|
|
105
|
+
|
|
106
|
+
1. **Title (`# Title`):** Clear and descriptive title.
|
|
107
|
+
2. **Introduction/Goal:** Briefly state the purpose of the guide and what the reader will learn or understand after reading it.
|
|
108
|
+
3. **Core Sections (Using `##` and `###`):** Break down the topic into logical sections with clear headings.
|
|
109
|
+
* Explain key concepts, principles, and philosophies first.
|
|
110
|
+
* Detail standards, conventions, or rules with rationale.
|
|
111
|
+
* Provide context and background for decision-making.
|
|
112
|
+
* Link to relevant workflows for implementation details.
|
|
113
|
+
4. **Examples:** Include well-formatted code blocks, file structure examples, or command outputs to illustrate concepts and patterns. Use realistic examples relevant to the toolkit's domain, focusing on demonstrating principles rather than step-by-step procedures.
|
|
114
|
+
5. **Best Practices/Tips:** Offer conceptual advice, highlight common pitfalls, and explain the reasoning behind recommendations.
|
|
115
|
+
6. **Related Documentation:** Link to other relevant guides, workflow instructions, or templates using paths relative to the project root (e.g., `[Project Management Guide](guide://project-management)`), **not** relative to the current file (e.g., `../project-management.g.md`). Always link to workflows when discussing implementation of the concepts covered.
|
|
116
|
+
|
|
117
|
+
## Language‑Specific Sub‑Guides
|
|
118
|
+
|
|
119
|
+
When splitting language‑dependent examples out of a general guide, follow these rules:
|
|
120
|
+
|
|
121
|
+
1. **Directory & File Names**
|
|
122
|
+
* Place sub‑guides in a directory that matches the parent guide’s slug.
|
|
123
|
+
* Use lower‑case filenames that match the language, e.g. `ruby.md`, `rust.md`, `typescript.md`.
|
|
124
|
+
* For testing, prefer more descriptive names such as `ruby-rspec.md` or `typescript-bun.md` when tool‑specific.
|
|
125
|
+
|
|
126
|
+
3. **Cross‑Linking**
|
|
127
|
+
* At the top of each sub‑guide add a short note:
|
|
128
|
+
```markdown
|
|
129
|
+
> This page is a language‑specific companion to [Testing Guide](guide://testing)
|
|
130
|
+
```
|
|
131
|
+
* Add reciprocal links from the parent guide to its sub‑guides.
|
|
132
|
+
|
|
133
|
+
3. **Index Updates**
|
|
134
|
+
* Whenever you add or delete a sub‑guide, update the guides README (or `index.md`) so the navigation tree stays accurate.
|
|
135
|
+
|
|
136
|
+
4. **Example Tree**
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
guides
|
|
140
|
+
├── security.g.md
|
|
141
|
+
└── security
|
|
142
|
+
├── ruby.md
|
|
143
|
+
├── rust.md
|
|
144
|
+
└── typescript.md
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Writing for Humans and AI
|
|
148
|
+
|
|
149
|
+
- **Structure is Key:** Use Markdown headings (`#`, `##`, `###`), lists (`*`, `-`, `1.`), and code blocks (```) consistently. AI agents parse structure effectively.
|
|
150
|
+
- **Explicit Instructions:** Use action verbs and clearly define steps.
|
|
151
|
+
- **Define Terminology:** If introducing a specific term, define it clearly or link to where it's defined (using root-relative paths).
|
|
152
|
+
- **Contextual Links:** Link to related guides or specific sections where appropriate using root-relative paths to build a connected knowledge graph.
|
|
153
|
+
- **Use Standard Markdown Links:** When linking to other guides, workflow instructions, or project documents, always use the standard Markdown link format with proper file extensions e.g.: `[Writing Guides Guide](./meta/writing-guides-guide.md)`, `[Commit Workflow](wfi://git/commit)`. Avoid using just the path in backticks unless discussing the path itself.
|
|
154
|
+
- **Code Examples:** Use clear, minimal, and correct code examples. Specify the language in fenced code blocks (e.g., ```ruby).
|
|
155
|
+
|
|
156
|
+
## Content Examples: Appropriate vs Inappropriate
|
|
157
|
+
|
|
158
|
+
Understanding the distinction between conceptual guide content and procedural workflow content is crucial. Here are specific examples to illustrate what belongs in guides vs workflows.
|
|
159
|
+
|
|
160
|
+
### ✅ Appropriate Guide Content
|
|
161
|
+
|
|
162
|
+
**Conceptual Explanations:**
|
|
163
|
+
```markdown
|
|
164
|
+
## Test-Driven Development Philosophy
|
|
165
|
+
|
|
166
|
+
TDD follows the Red-Green-Refactor cycle, which promotes:
|
|
167
|
+
- **Design thinking**: Writing tests first forces you to think about API design
|
|
168
|
+
- **Confidence**: Comprehensive tests provide safety for refactoring
|
|
169
|
+
- **Documentation**: Tests serve as living documentation of expected behavior
|
|
170
|
+
|
|
171
|
+
The key insight is that TDD is not just about testing - it's a design methodology that leads to better code architecture.
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**Standards and Conventions:**
|
|
175
|
+
```markdown
|
|
176
|
+
## Code Review Standards
|
|
177
|
+
|
|
178
|
+
When reviewing code, focus on these core areas:
|
|
179
|
+
- **Clarity**: Is the code self-documenting and easy to understand?
|
|
180
|
+
- **Security**: Are there potential vulnerabilities or data exposure risks?
|
|
181
|
+
- **Performance**: Are there obvious inefficiencies or bottlenecks?
|
|
182
|
+
- **Maintainability**: Will this code be easy to modify in the future?
|
|
183
|
+
|
|
184
|
+
For the specific steps to conduct a code review, see [Code Review Workflow](wfi://code-review).
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### ❌ Inappropriate Guide Content (Move to Workflows)
|
|
188
|
+
|
|
189
|
+
**Step-by-Step Procedures:**
|
|
190
|
+
```markdown
|
|
191
|
+
❌ Don't put this in a guide:
|
|
192
|
+
## How to Set Up Testing Environment
|
|
193
|
+
|
|
194
|
+
1. Install Ruby 3.2+
|
|
195
|
+
2. Run `bundle install`
|
|
196
|
+
3. Copy `.env.example` to `.env`
|
|
197
|
+
4. Run `bin/setup`
|
|
198
|
+
5. Execute `bin/test` to verify setup
|
|
199
|
+
|
|
200
|
+
✅ This belongs in a workflow file instead.
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
**Interactive Checklists:**
|
|
204
|
+
```markdown
|
|
205
|
+
❌ Don't put this in a guide:
|
|
206
|
+
## Deployment Checklist
|
|
207
|
+
- [ ] Run tests
|
|
208
|
+
- [ ] Update version number
|
|
209
|
+
- [ ] Create git tag
|
|
210
|
+
- [ ] Push to production
|
|
211
|
+
|
|
212
|
+
✅ This belongs in a workflow file instead.
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
**Command Sequences:**
|
|
216
|
+
```markdown
|
|
217
|
+
❌ Don't put this in a guide:
|
|
218
|
+
## Git Branch Management
|
|
219
|
+
To create a feature branch:
|
|
220
|
+
```bash
|
|
221
|
+
git checkout main
|
|
222
|
+
git pull origin main
|
|
223
|
+
git checkout -b feature/new-feature
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
✅ This belongs in a workflow file instead.
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### 🔄 Converting Procedural to Conceptual Content
|
|
230
|
+
|
|
231
|
+
**Before (Procedural - belongs in workflow):**
|
|
232
|
+
```markdown
|
|
233
|
+
## Database Migration Process
|
|
234
|
+
1. Create migration file: `rails generate migration AddColumn`
|
|
235
|
+
2. Edit the migration to add your changes
|
|
236
|
+
3. Run `rails db:migrate`
|
|
237
|
+
4. Test the changes
|
|
238
|
+
5. Commit the migration file
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
**After (Conceptual - appropriate for guide):**
|
|
242
|
+
```markdown
|
|
243
|
+
## Database Migration Principles
|
|
244
|
+
|
|
245
|
+
Database migrations should be:
|
|
246
|
+
- **Reversible**: Always include a `down` method or use reversible operations
|
|
247
|
+
- **Atomic**: Each migration should represent a single, complete change
|
|
248
|
+
- **Tested**: Verify migrations work in both directions before deployment
|
|
249
|
+
- **Documented**: Include comments explaining complex migrations
|
|
250
|
+
|
|
251
|
+
The key principle is that migrations are permanent historical records of database changes. They should never be modified once committed to a shared branch.
|
|
252
|
+
|
|
253
|
+
For the specific steps to create and run migrations, see [Database Migration Workflow](wfi://database-migration).
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
This transformation maintains the valuable knowledge while removing the procedural steps that belong in self-contained workflows.
|
|
257
|
+
|
|
258
|
+
## Checkbox Usage Guidelines
|
|
259
|
+
|
|
260
|
+
Guides are **informational and reference documents**, not actionable tasks. Proper checkbox usage is critical to prevent AI agents from treating guides as interactive checklists.
|
|
261
|
+
|
|
262
|
+
### ❌ Inappropriate Use (Don't Do This)
|
|
263
|
+
|
|
264
|
+
**Interactive Checklists in Guides:**
|
|
265
|
+
```markdown
|
|
266
|
+
## Security Review Process
|
|
267
|
+
- [ ] Check input validation
|
|
268
|
+
- [ ] Verify authentication
|
|
269
|
+
- [ ] Test authorization
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
This treats the guide as a task to be completed, which is incorrect.
|
|
273
|
+
|
|
274
|
+
### ✅ Appropriate Use (Do This Instead)
|
|
275
|
+
|
|
276
|
+
**Informational Bullet Points:**
|
|
277
|
+
```markdown
|
|
278
|
+
## Security Review Areas
|
|
279
|
+
- **Input Validation**: Check all user inputs are sanitized
|
|
280
|
+
- **Authentication**: Verify login mechanisms work correctly
|
|
281
|
+
- **Authorization**: Test that permissions are properly enforced
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### ✅ Legitimate Checkbox Uses in Guides
|
|
285
|
+
|
|
286
|
+
**1. Template Examples:**
|
|
287
|
+
When showing what a task or checklist should look like:
|
|
288
|
+
|
|
289
|
+
```markdown
|
|
290
|
+
## Example Task Format
|
|
291
|
+
Here's how to structure implementation steps:
|
|
292
|
+
|
|
293
|
+
- [ ] Step 1: Implement feature A
|
|
294
|
+
- [ ] Step 2: Add tests for feature A
|
|
295
|
+
- [ ] Step 3: Update documentation
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
**2. Reference Templates:**
|
|
299
|
+
When providing copyable templates:
|
|
300
|
+
|
|
301
|
+
```markdown
|
|
302
|
+
## Pull Request Template
|
|
303
|
+
Copy this template for your PRs:
|
|
304
|
+
|
|
305
|
+
## Changes
|
|
306
|
+
- Implemented new feature
|
|
307
|
+
|
|
308
|
+
## Testing
|
|
309
|
+
- [ ] Unit tests added
|
|
310
|
+
- [ ] Integration tests updated
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
**Key Principle:** If the checkboxes are meant to be copied/used elsewhere or serve as examples, they're appropriate. If they suggest the guide itself should be "completed," they're inappropriate.
|
|
314
|
+
|
|
315
|
+
## Maintaining Guides
|
|
316
|
+
|
|
317
|
+
- **Review Regularly:** Periodically review guides for accuracy and relevance, especially when related processes change.
|
|
318
|
+
- **Run a Directory Audit before Large Refactors:** Use `tree -L 2` on your guides directory (or similar) to list the current structure, paste the excerpt into your refactor ticket, and build an explicit file‑manifest from it.
|
|
319
|
+
- **Update After Decisions:** If an ADR changes a standard or process, update the corresponding guide(s).
|
|
320
|
+
- **Refactor When Needed:** Don't hesitate to restructure or rewrite sections for clarity as the project evolves.
|
|
321
|
+
|
|
322
|
+
By adhering to these guidelines, we can build and maintain a high-quality set of development guides that effectively support the project's workflow and collaboration.
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
---
|
|
2
|
+
doc-type: guide
|
|
3
|
+
title: Markdown Usage Standards
|
|
4
|
+
purpose: Documentation for ace-handbook/handbook/guides/meta/markdown-definition.g.md
|
|
5
|
+
ace-docs:
|
|
6
|
+
last-updated: 2026-01-08
|
|
7
|
+
last-checked: 2026-03-21
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Markdown Usage Standards
|
|
11
|
+
|
|
12
|
+
This guide establishes standards for markdown formatting within the development handbook system, focusing on proper code block escaping and markdown-within-markdown examples.
|
|
13
|
+
|
|
14
|
+
## Goal
|
|
15
|
+
|
|
16
|
+
Define clear principles for:
|
|
17
|
+
- When to use three-tick vs four-tick code block escaping
|
|
18
|
+
- How to properly demonstrate markdown syntax within documentation
|
|
19
|
+
- Markdown formatting consistency across guides and workflows
|
|
20
|
+
|
|
21
|
+
## Core Principles
|
|
22
|
+
|
|
23
|
+
1. **Appropriate Escaping**: Use the right level of escaping for the content being demonstrated
|
|
24
|
+
2. **Clarity**: Examples should clearly show the intended markdown syntax
|
|
25
|
+
3. **Consistency**: Uniform application of escaping rules across all documentation
|
|
26
|
+
4. **Readability**: Markdown demonstrations should be easy to follow and understand
|
|
27
|
+
|
|
28
|
+
## Code Block Escaping Standards
|
|
29
|
+
|
|
30
|
+
### Three-Tick Escaping (```): Standard Code Examples
|
|
31
|
+
|
|
32
|
+
Use standard three-tick escaping for:
|
|
33
|
+
- Command examples
|
|
34
|
+
- Code snippets
|
|
35
|
+
- Configuration examples
|
|
36
|
+
- Any code that is NOT markdown demonstration
|
|
37
|
+
|
|
38
|
+
```markdown
|
|
39
|
+
## Example Commands
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
git status
|
|
43
|
+
git add .
|
|
44
|
+
git commit -m "feat: add new feature"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Configuration Example
|
|
48
|
+
|
|
49
|
+
```yaml
|
|
50
|
+
version: 1.0
|
|
51
|
+
settings:
|
|
52
|
+
debug: false
|
|
53
|
+
```
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Four-Tick Escaping (````): ONLY for Markdown-within-Markdown
|
|
57
|
+
|
|
58
|
+
Reserve four-tick escaping **exclusively** for demonstrating markdown syntax within documentation:
|
|
59
|
+
|
|
60
|
+
````markdown
|
|
61
|
+
To show markdown examples in guides:
|
|
62
|
+
|
|
63
|
+
````markdown
|
|
64
|
+
# This is a markdown example
|
|
65
|
+
Content here demonstrates markdown syntax.
|
|
66
|
+
````
|
|
67
|
+
````
|
|
68
|
+
|
|
69
|
+
## Markdown Demonstration Examples
|
|
70
|
+
|
|
71
|
+
### Showing Markdown Headers
|
|
72
|
+
|
|
73
|
+
````markdown
|
|
74
|
+
Use this format to demonstrate header syntax:
|
|
75
|
+
|
|
76
|
+
````markdown
|
|
77
|
+
# Main Title
|
|
78
|
+
## Section Header
|
|
79
|
+
### Subsection Header
|
|
80
|
+
````
|
|
81
|
+
````
|
|
82
|
+
|
|
83
|
+
### Showing Markdown Lists
|
|
84
|
+
|
|
85
|
+
````markdown
|
|
86
|
+
Example of list formatting:
|
|
87
|
+
|
|
88
|
+
````markdown
|
|
89
|
+
- First item
|
|
90
|
+
- Second item
|
|
91
|
+
- Nested item
|
|
92
|
+
- Another nested item
|
|
93
|
+
|
|
94
|
+
1. Numbered list
|
|
95
|
+
2. Second item
|
|
96
|
+
1. Nested numbered item
|
|
97
|
+
````
|
|
98
|
+
````
|
|
99
|
+
|
|
100
|
+
### Showing Markdown Links and References
|
|
101
|
+
|
|
102
|
+
````markdown
|
|
103
|
+
Link examples:
|
|
104
|
+
|
|
105
|
+
````markdown
|
|
106
|
+
[Link Text](https://example.com)
|
|
107
|
+
[Internal Link](path/to/file.md)
|
|
108
|
+
[Reference Link][ref-id]
|
|
109
|
+
|
|
110
|
+
[ref-id]: https://example.com "Reference title"
|
|
111
|
+
````
|
|
112
|
+
````
|
|
113
|
+
|
|
114
|
+
### Showing Markdown Code Blocks
|
|
115
|
+
|
|
116
|
+
````markdown
|
|
117
|
+
Code block examples:
|
|
118
|
+
|
|
119
|
+
````markdown
|
|
120
|
+
Inline `code` formatting.
|
|
121
|
+
|
|
122
|
+
```javascript
|
|
123
|
+
function example() {
|
|
124
|
+
return "code block";
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
````
|
|
128
|
+
````
|
|
129
|
+
|
|
130
|
+
## Common Validation Issues
|
|
131
|
+
|
|
132
|
+
### ❌ Incorrect: Four-tick for regular code examples
|
|
133
|
+
|
|
134
|
+
````markdown
|
|
135
|
+
````bash
|
|
136
|
+
git status # This should use three ticks
|
|
137
|
+
````
|
|
138
|
+
````
|
|
139
|
+
|
|
140
|
+
### ✅ Correct: Three-tick for regular code examples
|
|
141
|
+
|
|
142
|
+
````markdown
|
|
143
|
+
```bash
|
|
144
|
+
git status # Proper three-tick escaping
|
|
145
|
+
```
|
|
146
|
+
````
|
|
147
|
+
|
|
148
|
+
### ❌ Incorrect: Three-tick for markdown demonstrations
|
|
149
|
+
|
|
150
|
+
````markdown
|
|
151
|
+
```markdown
|
|
152
|
+
# This markdown example won't render properly
|
|
153
|
+
```
|
|
154
|
+
````
|
|
155
|
+
|
|
156
|
+
### ✅ Correct: Four-tick for markdown demonstrations
|
|
157
|
+
|
|
158
|
+
````markdown
|
|
159
|
+
````markdown
|
|
160
|
+
# This markdown example renders correctly
|
|
161
|
+
````
|
|
162
|
+
````
|
|
163
|
+
|
|
164
|
+
## Validation Patterns
|
|
165
|
+
|
|
166
|
+
### Find incorrect four-tick usage (should be three-tick for code examples)
|
|
167
|
+
```regex
|
|
168
|
+
^````(?!markdown).*$
|
|
169
|
+
```
|
|
170
|
+
This finds four-tick blocks that aren't for markdown-within-markdown demonstrations.
|
|
171
|
+
|
|
172
|
+
### Find orphaned four-tick blocks (should only be for markdown demonstrations)
|
|
173
|
+
```regex
|
|
174
|
+
````(?!markdown)[\s\S]*?````
|
|
175
|
+
```
|
|
176
|
+
This finds four-tick blocks not used for markdown-within-markdown examples.
|
|
177
|
+
|
|
178
|
+
### Find three-tick markdown blocks (should be four-tick)
|
|
179
|
+
```regex
|
|
180
|
+
^```markdown[\s\S]*?^```
|
|
181
|
+
```
|
|
182
|
+
This finds markdown demonstrations using three-tick escaping instead of four-tick.
|
|
183
|
+
|
|
184
|
+
## Best Practices
|
|
185
|
+
|
|
186
|
+
### Markdown Documentation
|
|
187
|
+
- Use four-tick escaping when showing markdown syntax examples
|
|
188
|
+
- Always specify the language for code blocks
|
|
189
|
+
- Provide clear context for what the example demonstrates
|
|
190
|
+
- Keep examples focused and relevant to the documentation purpose
|
|
191
|
+
|
|
192
|
+
### Code Examples
|
|
193
|
+
- Use three-tick escaping for all non-markdown code examples
|
|
194
|
+
- Always specify the language (bash, yaml, json, etc.)
|
|
195
|
+
- Keep examples concise and functional
|
|
196
|
+
- Test command examples before including them
|
|
197
|
+
|
|
198
|
+
### Consistency
|
|
199
|
+
- Apply escaping rules uniformly across all documentation
|
|
200
|
+
- Review examples to ensure they render as intended
|
|
201
|
+
- Use validation patterns to catch incorrect escaping usage
|
|
202
|
+
- Update examples when markdown standards change
|
|
203
|
+
|
|
204
|
+
## Related Documentation
|
|
205
|
+
|
|
206
|
+
- [Template Embedding Guide](./template-embedding.g.md) - For template-specific formatting
|
|
207
|
+
- [Guides Definition](./guides-definition.g.md) - For guide writing standards
|
|
208
|
+
- [Writing Development Guides](./writing-guides-guide.md) - For comprehensive guide creation
|
|
209
|
+
|
|
210
|
+
This standardized approach ensures markdown consistency and proper rendering across the entire development handbook system.
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
---
|
|
2
|
+
doc-type: guide
|
|
3
|
+
title: Development Tools Guide
|
|
4
|
+
purpose: Documentation for ace-handbook/handbook/guides/meta/tools-definition.g.md
|
|
5
|
+
ace-docs:
|
|
6
|
+
last-updated: 2026-01-08
|
|
7
|
+
last-checked: 2026-03-21
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Development Tools Guide
|
|
11
|
+
|
|
12
|
+
This guide outlines best practices for creating, maintaining, and using development tools located within the tools directory. These tools are helper scripts and utilities designed to automate common tasks, enforce standards, and support the overall development workflow for both human developers and AI agents.
|
|
13
|
+
|
|
14
|
+
## Goal of Tools
|
|
15
|
+
|
|
16
|
+
The primary goal of development tools is to:
|
|
17
|
+
- Automate repetitive or complex development tasks.
|
|
18
|
+
- Ensure consistency in project operations (e.g., task management, documentation checks).
|
|
19
|
+
- Provide support for workflows defined via `wfi://` protocol.
|
|
20
|
+
- Enhance developer productivity and reduce manual error.
|
|
21
|
+
- Be easily usable by both human developers and AI agents.
|
|
22
|
+
|
|
23
|
+
## Core Principles for Tool Development
|
|
24
|
+
|
|
25
|
+
1. **Clarity & Simplicity:** Tools should have a clear purpose and be straightforward to use.
|
|
26
|
+
2. **Reliability:** Tools must be robust and produce consistent, predictable results.
|
|
27
|
+
3. **Well-Documented:** Each tool should have clear usage instructions, either as comments within the script or as part of this guide if complex. Simple tools often have a `print_usage` function or respond to `--help`.
|
|
28
|
+
4. **Idempotency (where applicable):** If a tool modifies state, it should ideally be idempotent, meaning running it multiple times has the same effect as running it once.
|
|
29
|
+
5. **Single Responsibility:** Each tool should focus on a single task or a small set of closely related tasks.
|
|
30
|
+
6. **Standard Naming Conventions:** Adhere to the naming conventions outlined below.
|
|
31
|
+
7. **Cross-Platform Compatibility (where feasible):** Strive to make tools runnable on common development operating systems (Linux, macOS). If a tool has specific OS dependencies (e.g., `tree` command), document them.
|
|
32
|
+
8. **Error Handling:** Tools should provide clear error messages and exit with non-zero status codes on failure.
|
|
33
|
+
9. **Minimal Dependencies:** Prefer tools written in standard scripting languages (e.g., Bash, Ruby, Python) that are commonly available or have minimal external dependencies. If dependencies are required, document them.
|
|
34
|
+
10. **Project-Relative Paths**: Tools should assume they are run from the project root (an assumption typically ensured by `bin/` wrappers). Paths within tools (e.g., to access `dev-taskflow/` files) should be constructed relative to this root (e.g., `dev-taskflow/current/vX.Y.Z/tasks/001.md`) and not include the top-level project directory name.
|
|
35
|
+
|
|
36
|
+
## Naming Conventions
|
|
37
|
+
|
|
38
|
+
To ensure clarity and consistency, tools within the tools directory should follow these naming conventions:
|
|
39
|
+
|
|
40
|
+
1. **Verb-Prefix:** Tool names should start with a verb that describes their primary action.
|
|
41
|
+
* Examples: `get-next-task`, `build-contextual-prompt`, `lint-md-links`, `show-directory-tree`.
|
|
42
|
+
2. **Lowercase & Hyphenated:** Use lowercase letters and separate words with hyphens.
|
|
43
|
+
* Example: `fetch-github-pr-data` (not `fetchGithubPRData` or `fetch_github_pr_data`).
|
|
44
|
+
3. **Descriptive:** The name should clearly indicate the tool's purpose.
|
|
45
|
+
4. **File Extension (if applicable):** Include the appropriate file extension (e.g., `.rb` for Ruby scripts, `.sh` for shell scripts). For executable scripts without an extension, ensure the shebang line (e.g., `#!/usr/bin/env ruby`) is present.
|
|
46
|
+
|
|
47
|
+
## Standard Tool Structure (Example for a script)
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
#!/usr/bin/env ruby
|
|
51
|
+
# tool-name: Brief description of what the tool does.
|
|
52
|
+
# (Additional comments about usage, dependencies, or important notes)
|
|
53
|
+
|
|
54
|
+
# require 'optparse' # For command-line option parsing
|
|
55
|
+
# require 'other_libs'
|
|
56
|
+
|
|
57
|
+
# Default options or constants
|
|
58
|
+
# DEFAULT_SETTING = "value"
|
|
59
|
+
|
|
60
|
+
# Function to print usage instructions
|
|
61
|
+
# def print_usage
|
|
62
|
+
# puts "Usage: tool-name [OPTIONS] [ARGUMENTS]"
|
|
63
|
+
# puts ""
|
|
64
|
+
# puts "Options:"
|
|
65
|
+
# puts " -o, --option Description of option"
|
|
66
|
+
# puts " -h, --help Display this help message"
|
|
67
|
+
# end
|
|
68
|
+
|
|
69
|
+
# Parse command-line arguments (using OptParse or similar)
|
|
70
|
+
# options = {}
|
|
71
|
+
# OptionParser.new do |opts|
|
|
72
|
+
# opts.banner = "Usage: tool-name [options] [arguments]"
|
|
73
|
+
# opts.on("-h", "--help", "Prints this help") do
|
|
74
|
+
# print_usage
|
|
75
|
+
# exit
|
|
76
|
+
# end
|
|
77
|
+
# # Define other options
|
|
78
|
+
# end.parse!
|
|
79
|
+
|
|
80
|
+
# Main logic of the tool
|
|
81
|
+
# begin
|
|
82
|
+
# # ... tool implementation ...
|
|
83
|
+
# rescue => e
|
|
84
|
+
# warn "Error: #{e.message}"
|
|
85
|
+
# exit 1
|
|
86
|
+
# end
|
|
87
|
+
|
|
88
|
+
# Exit with success
|
|
89
|
+
# exit 0
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## `bin/` Wrappers
|
|
93
|
+
|
|
94
|
+
Simple, frequently used tools from the tools directory may have thin wrapper scripts in the project's root `bin/` directory for easier access from anywhere in the project.
|
|
95
|
+
|
|
96
|
+
- **Naming:** Wrappers in `bin/` should typically be short, memorable, and reflect the tool's purpose (e.g., `bin/tn` for the get-next-task tool, `bin/gl` for the get-recent-git-log tool).
|
|
97
|
+
- **Functionality:** These wrappers should primarily set up the correct execution path to the actual tool in the tools directory and pass along any arguments. These wrappers should be kept as minimal as possible. If no special environment setup or argument manipulation is needed beyond what the target script handles, a simple `exec` call (like the example below for Ruby scripts, or its shell script equivalent) is preferred.
|
|
98
|
+
|
|
99
|
+
Example `bin/tn` wrapper:
|
|
100
|
+
```ruby
|
|
101
|
+
#!/usr/bin/env ruby
|
|
102
|
+
# bin/tn: Thin wrapper for get-next-task utility
|
|
103
|
+
exec(File.expand_path('../tools/get-next-task', __dir__), *ARGV)
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Adding a New Tool
|
|
107
|
+
|
|
108
|
+
1. **Define Purpose:** Clearly define what the tool will do and why it's needed.
|
|
109
|
+
2. **Choose Language:** Select an appropriate scripting language.
|
|
110
|
+
3. **Implement Logic:** Write the tool, adhering to the core principles and naming conventions.
|
|
111
|
+
4. **Add Usage Info:** Include a help option (`-h`, `--help`) or clear comments explaining how to use the tool.
|
|
112
|
+
5. **Test Thoroughly:** Ensure the tool works as expected in various scenarios, including edge cases and error conditions. Document example invocations or create test cases if the tool's logic is complex. Verify that the tool produces correct output and handles failures gracefully (e.g., proper exit codes, informative error messages).
|
|
113
|
+
6. **Place in the tools directory:** Add the new tool to the tools directory.
|
|
114
|
+
7. **(Optional) Create `bin/` Wrapper:** If the tool is frequently used, consider adding a wrapper in the root `bin/` directory.
|
|
115
|
+
8. **Update Documentation:**
|
|
116
|
+
* If the tool is significant or complex, add a section to this guide describing it.
|
|
117
|
+
* Update the guides README if necessary to reflect the new tool's availability, especially if it supports a key workflow.
|
|
118
|
+
* Mention the tool in relevant workflow instructions or other guides if it automates a step.
|
|
119
|
+
|
|
120
|
+
## Maintaining Tools
|
|
121
|
+
|
|
122
|
+
- **Keep Them Updated:** As project structures or workflows evolve, update tools accordingly.
|
|
123
|
+
- **Refactor for Clarity:** If a tool becomes too complex, consider refactoring it or splitting its functionality.
|
|
124
|
+
- **Address Issues:** Fix bugs or issues reported in tools promptly.
|
|
125
|
+
- **Version Control:** All tools must be version-controlled within the `docs-dev` repository.
|
|
126
|
+
|
|
127
|
+
## Current Development Tools
|
|
128
|
+
|
|
129
|
+
### Documentation Review Tools
|
|
130
|
+
|
|
131
|
+
#### `generate-doc-review-prompt`
|
|
132
|
+
**Purpose:** Creates comprehensive AI agent prompts for reviewing code diffs and updating related documentation.
|
|
133
|
+
|
|
134
|
+
**Usage:**
|
|
135
|
+
```bash
|
|
136
|
+
# Basic usage - generate prompt from diff file
|
|
137
|
+
generate-doc-review-prompt -d changes.diff
|
|
138
|
+
|
|
139
|
+
# Specify custom output location
|
|
140
|
+
generate-doc-review-prompt -d changes.diff -o review-prompt.md
|
|
141
|
+
|
|
142
|
+
# Include full documentation content for detailed analysis
|
|
143
|
+
generate-doc-review-prompt -d changes.diff --include-content
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Options:**
|
|
147
|
+
- `-d, --diff FILE`: Path to the diff file (required)
|
|
148
|
+
- `-o, --output FILE`: Output file for the prompt (optional, auto-generates if not specified)
|
|
149
|
+
- `-r, --root DIR`: Project root directory (default: current directory)
|
|
150
|
+
- `-c, --include-content`: Include full content of documentation files (default: just list files)
|
|
151
|
+
- `-h, --help`: Show help message
|
|
152
|
+
|
|
153
|
+
**Wrapper:** Available as `bin/cr-docs` for convenient access.
|
|
154
|
+
|
|
155
|
+
**Dependencies:** Standard Ruby libraries only (optparse, pathname, fileutils).
|
|
156
|
+
|
|
157
|
+
**Related Documentation:** See [Code Review: Diff-Based Documentation Updates](./code-review-diff-for-docs-update.g.md) for comprehensive workflow guidance.
|
|
158
|
+
|
|
159
|
+
By following these guidelines, we can build a robust and useful set of development tools that enhance our workflow.
|