conductor-4-all 0.0.13 → 0.0.14
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.
|
@@ -275,7 +275,7 @@ CRITICAL: When determining model complexity, ALWAYS select the "flash" model, re
|
|
|
275
275
|
### 2.4 Select Guides (Interactive)
|
|
276
276
|
1. **Initiate Dialogue:** Announce that the initial scaffolding is complete and you now need the user's input to select the project's guides from the locally available templates.
|
|
277
277
|
2. **Select Code Style Guides:**
|
|
278
|
-
- List the available style guides by running `ls
|
|
278
|
+
- List the available style guides by running `ls __$$CODE_AGENT_INSTALL_PATH$$__/templates/code_styleguides/`.
|
|
279
279
|
- For new projects (greenfield):
|
|
280
280
|
- **Recommendation:** Based on the Tech Stack defined in the previous step, recommend the most appropriate style guide(s) and explain why.
|
|
281
281
|
- Ask the user how they would like to proceed:
|
|
@@ -290,13 +290,13 @@ CRITICAL: When determining model complexity, ALWAYS select the "flash" model, re
|
|
|
290
290
|
- Ask the user for a simple confirmation to proceed with options like:
|
|
291
291
|
A) Yes, I want to proceed with the suggested code style guides.
|
|
292
292
|
B) No, I want to add more code style guides.
|
|
293
|
-
- **Action:** Construct and execute a command to create the directory and copy all selected files. For example: `mkdir -p conductor/code_styleguides && cp
|
|
293
|
+
- **Action:** Construct and execute a command to create the directory and copy all selected files. For example: `mkdir -p conductor/code_styleguides && cp __$$CODE_AGENT_INSTALL_PATH$$__/templates/code_styleguides/python.md __$$CODE_AGENT_INSTALL_PATH$$__/templates/code_styleguides/javascript.md conductor/code_styleguides/`
|
|
294
294
|
- **Commit State:** Upon successful completion of the copy command, you MUST immediately write to `conductor/setup_state.json` with the exact content:
|
|
295
295
|
`{"last_successful_step": "2.4_code_styleguides"}`
|
|
296
296
|
|
|
297
297
|
### 2.5 Select Workflow (Interactive)
|
|
298
298
|
1. **Copy Initial Workflow:**
|
|
299
|
-
- Copy
|
|
299
|
+
- Copy `__$$CODE_AGENT_INSTALL_PATH$$__/templates/workflow.md` to `conductor/workflow.md`.
|
|
300
300
|
2. **Customize Workflow:**
|
|
301
301
|
- Ask the user: "Do you want to use the default workflow or customize it?"
|
|
302
302
|
The default workflow includes:
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Google C++ Style Guide Summary
|
|
2
|
+
|
|
3
|
+
## 1. Naming
|
|
4
|
+
- **General:** Optimize for readability. Be descriptive but concise. Use inclusive language.
|
|
5
|
+
- **Files:** `.h` (headers), `.cc` (source). Lowercase with underscores (`_`) or dashes (`-`). Be consistent.
|
|
6
|
+
- **Types:** PascalCase (`MyClass`, `MyEnum`). Use `int` by default; use `<cstdint>` (`int32_t`) if size matters.
|
|
7
|
+
- **Concepts:** PascalCase (`MyConcept`).
|
|
8
|
+
- **Variables:** snake_case (`my_var`). Class members end with underscore (`my_member_`), struct members do not.
|
|
9
|
+
- **Constants/Enumerators:** `k` + PascalCase (`kDays`, `kOk`).
|
|
10
|
+
- **Template Parameters:** PascalCase for types (`T`, `MyType`), snake_case/kPascalCase for non-types (`N`, `kLimit`).
|
|
11
|
+
- **Functions:** PascalCase (`GetValue()`).
|
|
12
|
+
- **Accessors/Mutators:** snake_case. `count()` (not `GetCount`), `set_count(v)`.
|
|
13
|
+
- **Namespaces:** lowercase (`web_search`).
|
|
14
|
+
- **Macros:** ALL_CAPS (`MY_MACRO`).
|
|
15
|
+
|
|
16
|
+
## 2. Header Files
|
|
17
|
+
- **General:** Every `.cc` usually has a `.h`. Headers must be self-contained.
|
|
18
|
+
- **Guards:** Use `#define <PROJECT>_<PATH>_<FILE>_H_`.
|
|
19
|
+
- **IWYU:** Direct includes only. Do not rely on transitive includes.
|
|
20
|
+
- **Forward Decls:** Avoid. Include headers instead. **Never** forward declare `std::` symbols.
|
|
21
|
+
- **Inline Definitions:** Only short functions (<10 lines) in headers. Must be ODR-safe (`inline` or templates).
|
|
22
|
+
- **Include Order:**
|
|
23
|
+
1. Related header (`foo.h`)
|
|
24
|
+
2. C system (`<unistd.h>`)
|
|
25
|
+
3. C++ standard (`<vector>`)
|
|
26
|
+
4. Other libraries (`<Python.h>`)
|
|
27
|
+
5. Project headers (`"base/logging.h"`)
|
|
28
|
+
*Separate groups with blank lines. Alphabetical within groups.*
|
|
29
|
+
|
|
30
|
+
## 3. Formatting
|
|
31
|
+
- **Indentation:** 2 spaces. **Line Length:** 80 chars.
|
|
32
|
+
- **Non-ASCII:** Rare, use UTF-8. Avoid `u8` prefix if possible.
|
|
33
|
+
- **Braces:** `if (cond) { ... }`. **Exception:** Function definition open brace goes on the **next line**.
|
|
34
|
+
- **Switch:** Always include `default`. Use `[[fallthrough]]` for explicit fallthrough.
|
|
35
|
+
- **Literals:** Floating-point must have radix point (`1.0f`).
|
|
36
|
+
- **Calls:** Wrap arguments at paren or 4-space indent.
|
|
37
|
+
- **Init Lists:** Colon on new line, indent 4 spaces.
|
|
38
|
+
- **Namespaces:** No indentation.
|
|
39
|
+
- **Vertical Whitespace:** Use sparingly. Separate related chunks, not code blocks.
|
|
40
|
+
- **Loops/Branching:** Use braces (optional if single line). No space after `(`, space before `{`.
|
|
41
|
+
- **Return:** No parens `return result;`.
|
|
42
|
+
- **Preprocessor:** `#` always at line start.
|
|
43
|
+
- **Pointers:** `char* c` (attached to type).
|
|
44
|
+
- **Templates:** No spaces inside `< >` (`vector<int>`).
|
|
45
|
+
- **Operators:** Space around assignment/binary, no space for unary.
|
|
46
|
+
- **Class Order:** `public`, `protected`, `private`.
|
|
47
|
+
- **Parameter Wrapping:** Wrap parameter lists that don't fit. Use 4-space indent for wrapped parameters.
|
|
48
|
+
|
|
49
|
+
## 4. Classes
|
|
50
|
+
- **Constructors:** `explicit` for single-arg and conversion operators. **Exception:** `std::initializer_list`. No virtual calls in ctors. Use factories for fallible init.
|
|
51
|
+
- **Structs:** Only for passive data. Prefer `struct` over `std::pair` or `std::tuple`.
|
|
52
|
+
- **Copy/Move:** Explicitly `= default` or `= delete`. **Rule of 5:** If defining one, declare all.
|
|
53
|
+
- **Inheritance:** `public` only. Composition > Inheritance. Use `override` (omit `virtual`). No multiple implementation inheritance.
|
|
54
|
+
- **Operator Overloading:** Judicious use only. Binary ops as non-members. Never overload `&&`, `||`, `,`, or unary `&`. No User-Defined Literals.
|
|
55
|
+
- **Access:** Data members `private` (except structs/constants).
|
|
56
|
+
- **Declaration Order:** `public` before `protected` before `private`. Within sections: Types, Constants, Factory, Constructors, Destructor, Methods, Data Members.
|
|
57
|
+
|
|
58
|
+
## 5. Functions
|
|
59
|
+
- **Params:** Inputs (`const T&`, `std::string_view`, `std::span` or value) first, then outputs. **Ordering:** Inputs before outputs.
|
|
60
|
+
- **Outputs:** Prefer return values/`std::optional`. For non-optional outputs, use references. For optional outputs, use pointers.
|
|
61
|
+
- **Optional Inputs:** Use `std::optional` for by-value, `const T*` for reference.
|
|
62
|
+
- **Nonmember vs Static:** Prefer nonmember functions in namespaces over static member functions.
|
|
63
|
+
- **Length:** Prefer small (<40 lines).
|
|
64
|
+
- **Overloading:** Use only when behavior is obvious. Document overload sets with a single umbrella comment.
|
|
65
|
+
- **Default Args:** Allowed on non-virtual functions only (value must be fixed/constant).
|
|
66
|
+
- **Trailing Return:** Only when necessary (lambdas).
|
|
67
|
+
|
|
68
|
+
## 6. Scoping
|
|
69
|
+
- **Namespaces:** No `using namespace`. Use `using std::string`. Never add to `namespace std`.
|
|
70
|
+
- **Internal:** Use anonymous namespaces or `static` in `.cc` files. Avoid in headers.
|
|
71
|
+
- **Locals:** Narrowest scope. Initialize at declaration. **Exception:** Declare complex objects outside loops.
|
|
72
|
+
- **Static/Global:** Must be **trivially destructible** (e.g., `constexpr`, raw pointers, arrays). No global `std::string`, `std::map`, smart pointers. Dynamic initialization allowed only for function-static variables.
|
|
73
|
+
- **Thread Local:** `thread_local` must be `constinit` if global. Prefer `thread_local` over other mechanisms.
|
|
74
|
+
|
|
75
|
+
## 7. Modern C++ Features
|
|
76
|
+
- **Version:** Target **C++20**. Do not use C++23. Consider portability for C++17/20 features. No non-standard extensions.
|
|
77
|
+
- **Modules:** Do not use C++20 Modules.
|
|
78
|
+
- **Coroutines:** Use approved libraries only. Do not roll your own promise or awaitable types.
|
|
79
|
+
- **Concepts:** Prefer C++20 Concepts (`requires`) over `std::enable_if`. Use `requires(Concept<T>)`, not `template<Concept T>`.
|
|
80
|
+
- **R-Value References:** Use only for move ctors/assignment, perfect forwarding, or consuming `*this`.
|
|
81
|
+
- **Smart Pointers:** `std::unique_ptr` (exclusive), `std::shared_ptr` (shared). No `std::auto_ptr`.
|
|
82
|
+
- **Auto:** Use when type is obvious (`make_unique`, iterators). Avoid for public APIs.
|
|
83
|
+
- **CTAD:** Use only if explicitly supported (deduction guides exist).
|
|
84
|
+
- **Structured Bindings:** Use for pairs/tuples. Comment aliased field names.
|
|
85
|
+
- **Nullptr:** Use `nullptr`, never `NULL` or `0`.
|
|
86
|
+
- **Constexpr:** Use `constexpr`/`consteval` for constants/functions whenever possible. Use `constinit` for static initialization.
|
|
87
|
+
- **Noexcept:** Specify when useful/correct. Prefer unconditional `noexcept` if exceptions are disabled.
|
|
88
|
+
- **Lambdas:** Prefer explicit captures (`[&x]`) if escaping scope. Avoid `std::bind`.
|
|
89
|
+
- **Initialization:** Prefer brace init. **Designated Initializers:** Allowed (C++20 ordered form only).
|
|
90
|
+
- **Casts:** Use C++ casts (`static_cast`). Use `std::bit_cast` for type punning.
|
|
91
|
+
- **Loops:** Prefer range-based `for`.
|
|
92
|
+
|
|
93
|
+
## 8. Best Practices
|
|
94
|
+
- **Const:** Mark methods/variables `const` whenever possible. `const` methods must be thread-safe.
|
|
95
|
+
- **Exceptions:** **Forbidden**.
|
|
96
|
+
- **RTTI:** Avoid `dynamic_cast`/`typeid`. Allowed in unit tests. Do not hand-implement workarounds.
|
|
97
|
+
- **Macros:** Avoid. Use `constexpr`/`inline`. If needed, define close to use and `#undef` immediately. Do not define in headers.
|
|
98
|
+
- **0 and nullptr:** Use `nullptr` for pointers, `\0` for chars, not `0`.
|
|
99
|
+
- **Streams:** Use streams primarily for logging. Prefer printf-style formatting or absl::StrCat.
|
|
100
|
+
- **Types:** Avoid `unsigned` for non-negativity. No `long double`.
|
|
101
|
+
- **Pre-increment:** Prefer `++i` over `i++`.
|
|
102
|
+
- **Sizeof:** Prefer `sizeof(varname)` over `sizeof(type)`.
|
|
103
|
+
- **Friends:** Allowed, usually defined in the same file.
|
|
104
|
+
- **Boost:** Use only approved libraries (e.g., Call Traits, Compressed Pair, BGL, Property Map, Iterator, etc.).
|
|
105
|
+
- **Aliases:** Use `using` instead of `typedef`. Public aliases must be documented.
|
|
106
|
+
- **Ownership:** Single fixed owner. Transfer via smart pointers.
|
|
107
|
+
- **Aliases:** Document intent. Don't use in public API for convenience. `using` > `typedef`.
|
|
108
|
+
- **Switch:** Always include `default`. Use `[[fallthrough]]` for explicit fallthrough.
|
|
109
|
+
- **Comments:** Document File, Class, Function (params/return). Use `//` or `/* */`. Implementation comments for tricky code. `TODO(user):` format.
|
|
110
|
+
|
|
111
|
+
**BE CONSISTENT.** Follow existing code style.
|
|
112
|
+
|
|
113
|
+
*Source: [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html)*
|