opencode-conductor-plugin 1.1.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.
Files changed (57) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +91 -0
  3. package/dist/commands/implement.d.ts +2 -0
  4. package/dist/commands/implement.js +17 -0
  5. package/dist/commands/newTrack.d.ts +2 -0
  6. package/dist/commands/newTrack.js +19 -0
  7. package/dist/commands/revert.d.ts +2 -0
  8. package/dist/commands/revert.js +17 -0
  9. package/dist/commands/setup.d.ts +2 -0
  10. package/dist/commands/setup.js +19 -0
  11. package/dist/commands/status.d.ts +2 -0
  12. package/dist/commands/status.js +15 -0
  13. package/dist/index.d.ts +3 -0
  14. package/dist/index.js +97 -0
  15. package/dist/prompts/agent/conductor.md +33 -0
  16. package/dist/prompts/agent.md +23 -0
  17. package/dist/prompts/commands/c-implement.md +5 -0
  18. package/dist/prompts/commands/c-new.md +5 -0
  19. package/dist/prompts/commands/c-revert.md +5 -0
  20. package/dist/prompts/commands/c-setup.md +5 -0
  21. package/dist/prompts/commands/c-status.md +5 -0
  22. package/dist/prompts/implement.toml +170 -0
  23. package/dist/prompts/newTrack.toml +144 -0
  24. package/dist/prompts/revert.toml +123 -0
  25. package/dist/prompts/setup.toml +426 -0
  26. package/dist/prompts/status.toml +57 -0
  27. package/dist/templates/code_styleguides/c.md +28 -0
  28. package/dist/templates/code_styleguides/cpp.md +46 -0
  29. package/dist/templates/code_styleguides/csharp.md +115 -0
  30. package/dist/templates/code_styleguides/dart.md +238 -0
  31. package/dist/templates/code_styleguides/general.md +23 -0
  32. package/dist/templates/code_styleguides/go.md +48 -0
  33. package/dist/templates/code_styleguides/html-css.md +49 -0
  34. package/dist/templates/code_styleguides/java.md +39 -0
  35. package/dist/templates/code_styleguides/javascript.md +51 -0
  36. package/dist/templates/code_styleguides/julia.md +27 -0
  37. package/dist/templates/code_styleguides/kotlin.md +41 -0
  38. package/dist/templates/code_styleguides/php.md +37 -0
  39. package/dist/templates/code_styleguides/python.md +37 -0
  40. package/dist/templates/code_styleguides/react.md +37 -0
  41. package/dist/templates/code_styleguides/ruby.md +39 -0
  42. package/dist/templates/code_styleguides/rust.md +44 -0
  43. package/dist/templates/code_styleguides/shell.md +35 -0
  44. package/dist/templates/code_styleguides/solidity.md +60 -0
  45. package/dist/templates/code_styleguides/sql.md +39 -0
  46. package/dist/templates/code_styleguides/swift.md +36 -0
  47. package/dist/templates/code_styleguides/typescript.md +43 -0
  48. package/dist/templates/code_styleguides/vue.md +38 -0
  49. package/dist/templates/code_styleguides/zig.md +27 -0
  50. package/dist/templates/workflow.md +333 -0
  51. package/dist/utils/bootstrap.d.ts +1 -0
  52. package/dist/utils/bootstrap.js +49 -0
  53. package/dist/utils/promptLoader.d.ts +1 -0
  54. package/dist/utils/promptLoader.js +23 -0
  55. package/dist/utils/stateManager.d.ts +10 -0
  56. package/dist/utils/stateManager.js +30 -0
  57. package/package.json +74 -0
@@ -0,0 +1,37 @@
1
+ # PHP Style Guide Summary (PSR-12)
2
+
3
+ This document summarizes key rules from the PSR-12 Extended Coding Style Guide, which is the current standard for the PHP community.
4
+
5
+ ## 1. Files and Basic Standards
6
+ - **PHP Tag**: Use only `<?php` or `<?=`.
7
+ - **Encoding**: UTF-8 without BOM.
8
+ - **Side Effects**: A file should either declare symbols (classes, functions, constants, etc.) or cause side effects, but not both.
9
+ - **Indentation**: 4 spaces.
10
+
11
+ ## 2. Naming Conventions
12
+ - **Classes**: `UpperCamelCase` (e.g., `UserMapper`).
13
+ - **Methods**: `lowerCamelCase` (e.g., `getUserData`).
14
+ - **Constants**: `CONSTANT_CASE` (e.g., `MAX_RETRIES`).
15
+ - **Properties**: `lowerCamelCase` (preferred) or `snake_case` (be consistent).
16
+
17
+ ## 3. Structure and Layout
18
+ - **Namespaces**: One declaration per line.
19
+ - **Imports**: Use `use` for imports. Group imports by type (classes, functions, constants).
20
+ - **Visibility**: Always declare visibility (`public`, `protected`, `private`) for properties and methods.
21
+ - **Strict Types**: Use `declare(strict_types=1);` at the top of every file.
22
+
23
+ ## 4. Control Structures
24
+ - **Braces**: Opening brace on the same line for control structures, but on a new line for classes and methods (PSR style).
25
+ - **Conditionals**: Always use curly braces, even for one-line blocks.
26
+ - **Spaces**: One space after the control structure keyword, no space after the opening parenthesis.
27
+
28
+ ## 5. Functions and Methods
29
+ - **Type Hinting**: Always use type hints for parameters and return types.
30
+ - **Nullables**: Use `?Type` or `Type | null` for nullable types.
31
+ - **Return Type**: The colon and type should follow the closing parenthesis with a space.
32
+
33
+ ## 6. Documentation (DocBlocks)
34
+ - Use standard PHPDoc `/** ... */` for documenting classes, methods, and properties.
35
+ - Include `@param` and `@return` tags with specific types.
36
+
37
+ *Source: [PHP-FIG PSR-12](https://www.php-fig.org/psr/psr-12/)*
@@ -0,0 +1,37 @@
1
+ # Google Python Style Guide Summary
2
+
3
+ This document summarizes key rules and best practices from the Google Python Style Guide.
4
+
5
+ ## 1. Python Language Rules
6
+ - **Linting:** Run `pylint` on your code to catch bugs and style issues.
7
+ - **Imports:** Use `import x` for packages/modules. Use `from x import y` only when `y` is a submodule.
8
+ - **Exceptions:** Use built-in exception classes. Do not use bare `except:` clauses.
9
+ - **Global State:** Avoid mutable global state. Module-level constants are okay and should be `ALL_CAPS_WITH_UNDERSCORES`.
10
+ - **Comprehensions:** Use for simple cases. Avoid for complex logic where a full loop is more readable.
11
+ - **Default Argument Values:** Do not use mutable objects (like `[]` or `{}`) as default values.
12
+ - **True/False Evaluations:** Use implicit false (e.g., `if not my_list:`). Use `if foo is None:` to check for `None`.
13
+ - **Type Annotations:** Strongly encouraged for all public APIs.
14
+
15
+ ## 2. Python Style Rules
16
+ - **Line Length:** Maximum 80 characters.
17
+ - **Indentation:** 4 spaces per indentation level. Never use tabs.
18
+ - **Blank Lines:** Two blank lines between top-level definitions (classes, functions). One blank line between method definitions.
19
+ - **Whitespace:** Avoid extraneous whitespace. Surround binary operators with single spaces.
20
+ - **Docstrings:** Use `"""triple double quotes"""`. Every public module, function, class, and method must have a docstring.
21
+ - **Format:** Start with a one-line summary. Include `Args:`, `Returns:`, and `Raises:` sections.
22
+ - **Strings:** Use f-strings for formatting. Be consistent with single (`'`) or double (`"`) quotes.
23
+ - **`TODO` Comments:** Use `TODO(username): Fix this.` format.
24
+ - **Imports Formatting:** Imports should be on separate lines and grouped: standard library, third-party, and your own application's imports.
25
+
26
+ ## 3. Naming
27
+ - **General:** `snake_case` for modules, functions, methods, and variables.
28
+ - **Classes:** `PascalCase`.
29
+ - **Constants:** `ALL_CAPS_WITH_UNDERSCORES`.
30
+ - **Internal Use:** Use a single leading underscore (`_internal_variable`) for internal module/class members.
31
+
32
+ ## 4. Main
33
+ - All executable files should have a `main()` function that contains the main logic, called from a `if __name__ == '__main__':` block.
34
+
35
+ **BE CONSISTENT.** When editing code, match the existing style.
36
+
37
+ *Source: [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html)*
@@ -0,0 +1,37 @@
1
+ # React Best Practices & Style Guide
2
+
3
+ This document outlines recommended patterns and styles for building React applications with functional components and hooks.
4
+
5
+ ## 1. Components
6
+ - **Functional Components**: Prefer functional components with Hooks over class components.
7
+ - **Naming**: Use `PascalCase` for component filenames and function names (e.g., `UserProfile.tsx`).
8
+ - **One Component per File**: Each file should export exactly one primary component.
9
+ - **Props**:
10
+ - Use TypeScript interfaces/types for prop definitions.
11
+ - Destructure props in the function signature for clarity.
12
+ - Provide default values using ES6 default parameters.
13
+
14
+ ## 2. Hooks
15
+ - **Rules of Hooks**: Follow the official rules (only call at top level, only in React functions).
16
+ - **Custom Hooks**: Extract complex logic into custom hooks (`useSomeLogic`). Name them with the `use` prefix.
17
+ - **Dependencies**: Be exhaustive with dependency arrays in `useEffect`, `useMemo`, and `useCallback`.
18
+
19
+ ## 3. Styling
20
+ - **CSS-in-JS / Modules**: Prefer CSS Modules or a utility-first framework like Tailwind CSS over global CSS.
21
+ - **Conditional Classes**: Use a utility like `clsx` or `classnames` for managing conditional class strings.
22
+
23
+ ## 4. State Management
24
+ - **Local State**: Use `useState` for simple, component-specific state.
25
+ - **Complex State**: Use `useReducer` for more complex state logic or when state transitions depend on previous state.
26
+ - **Context API**: Use `useContext` for sharing state that is "global" to a tree of components (e.g., theme, user session).
27
+
28
+ ## 5. Patterns
29
+ - **Container/Presenter**: While less strict now, keep data fetching/logic separate from pure presentation components where it improves testability.
30
+ - **Composition**: Prefer component composition (`children` prop) over deep prop drilling.
31
+ - **Early Returns**: Use early returns for conditional rendering (e.g., loading or error states).
32
+
33
+ ## 6. Performance
34
+ - **useMemo/useCallback**: Use sparingly. Only memoize when profiling shows a performance bottleneck or when passing objects/functions to memoized child components.
35
+ - **Fragment**: Use `<React.Fragment>` or `<>` to avoid unnecessary DOM nodes.
36
+
37
+ *Source: [Official React Documentation](https://react.dev/)*
@@ -0,0 +1,39 @@
1
+ # Ruby Style Guide Summary
2
+
3
+ This document summarizes key rules and best practices for Ruby development, largely based on the community-driven Ruby Style Guide and RuboCop defaults.
4
+
5
+ ## 1. Source Code Layout
6
+ - **Indentation**: 2 spaces per indentation level.
7
+ - **Line Length**: Limit lines to 80 characters where possible.
8
+ - **Spaces**: Use spaces around operators, after commas, colons, and semicolons.
9
+ - **Newlines**: End each file with a single newline.
10
+
11
+ ## 2. Naming Conventions
12
+ - **Classes and Modules**: `UpperCamelCase`.
13
+ - **Methods and Variables**: `snake_case`.
14
+ - **Constants**: `SCREAMING_SNAKE_CASE`.
15
+ - **Predicate Methods**: Methods returning booleans should end with a question mark (e.g., `is_empty?`).
16
+ - **Bang Methods**: Methods that modify the receiver or are "dangerous" should end with an exclamation mark (e.g., `save!`).
17
+
18
+ ## 3. Syntax and Style
19
+ - **Quoting**: Prefer single quotes (`'`) for strings that don't require interpolation or special characters.
20
+ - **Interpolation**: Use `#{expression}` for string interpolation.
21
+ - **Arrays**: Prefer the literal syntax `[]`. Use `%w()` for arrays of words.
22
+ - **Hashes**: Use the Ruby 1.9+ syntax `key: value` for symbol keys.
23
+ - **Conditionals**: Avoid `then` in `if/unless` statements. Use `unless` instead of `if !condition`.
24
+ - **Method Definitions**: Use parentheses when a method has parameters. Omit them when it doesn't.
25
+
26
+ ## 4. Collections
27
+ - **Iteration**: Prefer `each` over `for`.
28
+ - **Transformation**: Use `map`, `select`, `reduce` for collection operations.
29
+ - **Selection**: Use `find` or `detect` to find a single element.
30
+
31
+ ## 5. Exceptions
32
+ - **Control Flow**: Avoid using exceptions for control flow.
33
+ - **Rescue**: Be specific about the exception classes you rescue. Never rescue `Exception` (rescue `StandardError` instead).
34
+
35
+ ## 6. Documentation
36
+ - **Comments**: Use `#` for comments.
37
+ - **Yard**: Use YARD-style documentation tags for methods and classes.
38
+
39
+ *Source: [The Ruby Style Guide](https://rubystyle.guide/)*
@@ -0,0 +1,44 @@
1
+ # Rust Style Guide Summary
2
+
3
+ This document summarizes key rules and best practices for Rust development, based on the official Rust style guidelines and common idiomatic patterns.
4
+
5
+ ## 1. Naming Conventions
6
+ - **`UpperCamelCase`**: Types (structs, enums, traits), type aliases, and enum variants.
7
+ - **`snake_case`**: Crates, modules, functions, methods, variables, and arguments.
8
+ - **`SCREAMING_SNAKE_CASE`**: Statics and constants.
9
+ - **`T` (Single Letter)**: Type parameters (e.g., `<T>`, `<U>`).
10
+
11
+ ## 2. Formatting (Rustfmt)
12
+ - Use 4-space indentation.
13
+ - Maximum line width: 100 characters.
14
+ - Use curly braces for all `if`, `else`, `while`, and `loop` blocks.
15
+ - Place the opening brace on the same line as the declaration.
16
+
17
+ ## 3. Idiomatic Patterns
18
+ - **Pattern Matching**: Prefer `match` or `if let` over complex nested `if` statements.
19
+ - **Error Handling**:
20
+ - Use `Result<T, E>` for recoverable errors and `Option<T>` for optional values.
21
+ - Use the `?` operator for concise error propagation.
22
+ - Avoid `unwrap()` and `expect()` in production code unless a panic is truly intended.
23
+ - **Ownership and Borrowing**:
24
+ - Prefer immutable borrows (`&T`) by default.
25
+ - Use mutable borrows (`&mut T`) only when necessary.
26
+ - Avoid unnecessary cloning; prefer passing references.
27
+ - **Iterators**: Use iterator methods (`map`, `filter`, `fold`, etc.) instead of manual loops where it improves clarity.
28
+
29
+ ## 4. Documentation
30
+ - Use `///` for documentation comments on items (functions, structs, etc.).
31
+ - Use `//!` for module-level or crate-level documentation.
32
+ - Documentation should include an "Examples" section using markdown code blocks.
33
+ - Markdown is supported and encouraged in doc comments.
34
+
35
+ ## 5. Attributes and Macros
36
+ - Use `#[derive(...)]` for common traits like `Debug`, `Clone`, `PartialEq`, and `Serialize`.
37
+ - Keep macros simple and well-documented. Avoid complex macro logic where regular functions suffice.
38
+
39
+ ## 6. Dependencies (Cargo.toml)
40
+ - Be explicit with versioning.
41
+ - Periodically run `cargo update` and `cargo audit` to manage security vulnerabilities.
42
+ - Prefer small, focused crates over large "kitchen sink" dependencies.
43
+
44
+ *Source: [Official Rust Style Guidelines](https://github.com/rust-lang/rust/tree/master/src/doc/style-guide)*
@@ -0,0 +1,35 @@
1
+ # Shell Style Guide Summary (Bash)
2
+
3
+ This document outlines best practices for writing clean, safe, and maintainable shell scripts, based on the Google Shell Style Guide and common idiomatic patterns.
4
+
5
+ ## 1. General Principles
6
+ - **Shebang**: Use `#!/bin/bash` or `#!/usr/bin/env bash`.
7
+ - **Portability**: If you don't need Bash-specific features, use `#!/bin/sh`.
8
+ - **Fail Fast**: Use `set -euo pipefail` at the beginning of scripts to exit on errors, unset variables, and pipeline failures.
9
+
10
+ ## 2. Naming Conventions
11
+ - **Files**: `snake_case` with `.sh` extension.
12
+ - **Variables**: `snake_case` for local variables. `UPPERCASE` for constants and environment variables.
13
+ - **Functions**: `snake_case`.
14
+
15
+ ## 3. Formatting
16
+ - **Indentation**: 2 spaces.
17
+ - **Line Length**: Limit to 80 characters where possible.
18
+ - **Functions**: Use the standard `function_name() { ... }` syntax.
19
+
20
+ ## 4. Safety and Robustness
21
+ - **Quoting**: Always quote variables that contain filenames or user input (e.g., `"$file"`) to prevent word splitting and globbing.
22
+ - **Command Substitution**: Use `$(command)` instead of backticks.
23
+ - **Conditionals**: Use `[[ ... ]]` instead of `[ ... ]` or `test` for Bash scripts.
24
+ - **Local Variables**: Always use the `local` keyword inside functions.
25
+
26
+ ## 5. Idiomatic Patterns
27
+ - **Main Function**: Put the script logic in a `main` function and call it at the bottom.
28
+ - **Logging**: Use a dedicated `log` or `error` function for consistent output.
29
+ - **Check for Existence**: Always check if a command exists before using it (e.g., `command -v git >/dev/null 2>&1`).
30
+
31
+ ## 6. Documentation
32
+ - **Header**: Include a brief description, usage examples, and author information at the top of the script.
33
+ - **Comments**: Use `#` to explain *why* complex commands are used.
34
+
35
+ *Source: [Google Shell Style Guide](https://google.github.io/styleguide/shellguide.html)*
@@ -0,0 +1,60 @@
1
+ # Solidity Style Guide Summary
2
+
3
+ This document summarizes key rules and best practices for Solidity development, based on the official Solidity Style Guide and industry standards from OpenZeppelin and ConsenSys.
4
+
5
+ ## 1. Source File Organization
6
+ - **License Identifier**: Every source file should start with a machine-readable SPDX license identifier (e.g., `// SPDX-License-Identifier: MIT`).
7
+ - **Pragma**: Use a specific compiler version (e.g., `pragma solidity 0.8.20;`) rather than a floating pragma (`^0.8.20`) for deployed contracts to ensure deterministic builds.
8
+ - **Layout Order**:
9
+ 1. License Identifier
10
+ 2. Pragma statements
11
+ 3. Import statements
12
+ 4. Interfaces
13
+ 5. Libraries
14
+ 6. Contracts
15
+
16
+ ## 2. Contract Layout
17
+ Inside each contract, library, or interface, use the following order:
18
+ 1. Type declarations (enums, structs)
19
+ 2. State variables
20
+ 3. Events
21
+ 4. Modifiers
22
+ 5. Functions
23
+
24
+ **Function Order**:
25
+ - Constructor
26
+ - Receive function (if exists)
27
+ - Fallback function (if exists)
28
+ - External
29
+ - Public
30
+ - Internal
31
+ - Private
32
+
33
+ ## 3. Naming Conventions
34
+ - **Contracts & Libraries**: `UpperCamelCase` (e.g., `SimpleToken`).
35
+ - **Structs & Enums**: `UpperCamelCase` (e.g., `UserAccount`).
36
+ - **Events**: `UpperCamelCase` (e.g., `Transfer`).
37
+ - **Functions**: `lowerCamelCase` (e.g., `getBalance`).
38
+ - **Function Arguments**: `lowerCamelCase` (e.g., `_address`).
39
+ - **Local & State Variables**: `lowerCamelCase` (e.g., `accountBalance`).
40
+ - **Constants**: `UPPER_CASE_WITH_UNDERSCORES` (e.g., `MAX_SUPPLY`).
41
+ - **Modifiers**: `lowerCamelCase` (e.g., `onlyOwner`).
42
+ - **Private/Internal**: It is common practice to prefix internal or private state variables and functions with an underscore (e.g., `_balances`).
43
+
44
+ ## 4. Security Best Practices
45
+ - **Checks-Effects-Interactions**: Always follow this pattern to prevent reentrancy attacks.
46
+ 1. **Checks**: Validate inputs and conditions (e.g., `require`).
47
+ 2. **Effects**: Update the contract state (e.g., update balances).
48
+ 3. **Interactions**: Interact with other contracts (e.g., `transfer` or external calls).
49
+ - **Visibility**: Always explicitly define visibility for all functions (`external`, `public`, `internal`, or `private`).
50
+ - **Error Handling**: Use `revert CustomError()` (Solidity 0.8.4+) for gas efficiency instead of string-based `require`.
51
+ - **Overflow/Underflow**: Use Solidity 0.8.0+ which has built-in overflow checks, or `SafeMath` for older versions.
52
+
53
+ ## 5. Documentation (NatSpec)
54
+ Use Ethereum Natural Language Specification (NatSpec) for all public and external interfaces:
55
+ - `/// @notice`: Explain to an end user what this does.
56
+ - `/// @dev`: Explain to a developer any extra details.
57
+ - `/// @param`: Document a parameter.
58
+ - `/// @return`: Document a return value.
59
+
60
+ *Source: [Solidity Documentation - Style Guide](https://docs.soliditylang.org/en/latest/style-guide.html)*
@@ -0,0 +1,39 @@
1
+ # SQL Style Guide Summary
2
+
3
+ This document outlines best practices for writing clean, readable, and maintainable SQL queries and schema definitions.
4
+
5
+ ## 1. Keywords and Naming
6
+ - **Keywords**: Use `UPPERCASE` for all SQL keywords (e.g., `SELECT`, `FROM`, `WHERE`).
7
+ - **Identifiers**: Use `snake_case` for all table names, column names, and other identifiers.
8
+ - **Singular vs Plural**: Prefer singular table names (e.g., `user` instead of `users`).
9
+ - **Reserved Words**: Never use reserved SQL keywords as identifiers.
10
+
11
+ ## 2. Query Structure
12
+ - **Formatting**:
13
+ - One major clause per line (`SELECT`, `FROM`, `JOIN`, `WHERE`, `GROUP BY`, `ORDER BY`).
14
+ - Indent subclauses (e.g., inside `WHERE` or `JOIN`) for clarity.
15
+ - **Columns**: Explicitly list all columns in `SELECT` statements. Avoid `SELECT *` in production code.
16
+ - **Joins**:
17
+ - Use explicit `JOIN` syntax (e.g., `INNER JOIN`, `LEFT JOIN`).
18
+ - Use the `ON` clause for join conditions.
19
+ - **Aliases**: Use descriptive aliases for tables, especially in multi-table joins.
20
+
21
+ ## 3. Data Types and Constraints
22
+ - **Consistency**: Use consistent data types across the schema.
23
+ - **Constraints**:
24
+ - Always define a `PRIMARY KEY`.
25
+ - Use `FOREIGN KEY` constraints to enforce referential integrity.
26
+ - Use `NOT NULL` where appropriate.
27
+ - Use `DEFAULT` values instead of allowing `NULL` where a sensible default exists.
28
+
29
+ ## 4. Performance and Best Practices
30
+ - **Indexing**: Create indexes on columns used in `WHERE`, `JOIN`, and `ORDER BY` clauses.
31
+ - **Transactions**: Use transactions for multi-step operations to ensure atomicity.
32
+ - **Comments**: Use `--` for single-line comments and `/* ... */` for block comments to explain complex logic.
33
+
34
+ ## 5. Migrations
35
+ - **Incremental**: Apply schema changes through version-controlled migration files.
36
+ - **Idempotent**: Ensure migrations are idempotent where possible (though typically managed by a tool).
37
+ - **Rollback**: Always include a rollback path for schema changes.
38
+
39
+ *Source: [SQL Style Guide (General Best Practices)](https://www.sqlstyle.guide/)*
@@ -0,0 +1,36 @@
1
+ # Swift Style Guide Summary
2
+
3
+ This document summarizes key rules and best practices for Swift development, based on the official Swift API Design Guidelines and common community standards.
4
+
5
+ ## 1. Naming Conventions
6
+ - **Types (Structs, Classes, Enums, Protocols)**: `UpperCamelCase`.
7
+ - **Functions, Variables, Arguments**: `lowerCamelCase`.
8
+ - **Enum Variants**: `lowerCamelCase`.
9
+ - **Clarity over Brevity**: Prefer descriptive names over short ones (e.g., `remove(at:)` instead of `delete()`).
10
+
11
+ ## 2. Formatting
12
+ - **Indentation**: 4 spaces (standard for Xcode/Swift).
13
+ - **Line Width**: Limit to 100-120 characters.
14
+ - **Braces**: Opening brace on the same line as the declaration.
15
+
16
+ ## 3. Optionals and Control Flow
17
+ - **Optional Binding**: Prefer `if let` or `guard let` over `!` (force unwrap).
18
+ - **Early Exit**: Use `guard` statements to keep the main logic at the lowest indentation level.
19
+ - **Switch Statements**: Always include a `default` case unless all cases are exhaustively covered.
20
+
21
+ ## 4. Idiomatic Swift
22
+ - **Type Inference**: Rely on Swift's type inference for local variables.
23
+ - **Structs vs Classes**: Prefer `struct` by default. Use `class` only when you need reference semantics or inheritance.
24
+ - **Extensions**: Use `extension` to group related functionality or implement protocols.
25
+ - **Trailing Closures**: Use trailing closure syntax when a function's last argument is a closure.
26
+
27
+ ## 5. Error Handling
28
+ - Use `Error` protocol and `throw` for recoverable errors.
29
+ - Use `Result` type for asynchronous error handling.
30
+ - Avoid `try!` unless failure is genuinely impossible.
31
+
32
+ ## 6. Access Control
33
+ - Use `private` or `fileprivate` by default for implementation details.
34
+ - Be explicit about `public` or `internal` (though `internal` is the default).
35
+
36
+ *Source: [Swift.org API Design Guidelines](https://www.swift.org/documentation/api-design-guidelines/)*
@@ -0,0 +1,43 @@
1
+ # Google TypeScript Style Guide Summary
2
+
3
+ This document summarizes key rules and best practices from the Google TypeScript Style Guide, which is enforced by the `gts` tool.
4
+
5
+ ## 1. Language Features
6
+ - **Variable Declarations:** Always use `const` or `let`. **`var` is forbidden.** Use `const` by default.
7
+ - **Modules:** Use ES6 modules (`import`/`export`). **Do not use `namespace`.**
8
+ - **Exports:** Use named exports (`export {MyClass};`). **Do not use default exports.**
9
+ - **Classes:**
10
+ - **Do not use `#private` fields.** Use TypeScript's `private` visibility modifier.
11
+ - Mark properties never reassigned outside the constructor with `readonly`.
12
+ - **Never use the `public` modifier** (it's the default). Restrict visibility with `private` or `protected` where possible.
13
+ - **Functions:** Prefer function declarations for named functions. Use arrow functions for anonymous functions/callbacks.
14
+ - **String Literals:** Use single quotes (`'`). Use template literals (`` ` ``) for interpolation and multi-line strings.
15
+ - **Equality Checks:** Always use triple equals (`===`) and not equals (`!==`).
16
+ - **Type Assertions:** **Avoid type assertions (`x as SomeType`) and non-nullability assertions (`y!`)**. If you must use them, provide a clear justification.
17
+
18
+ ## 2. Disallowed Features
19
+ - **`any` Type:** **Avoid `any`**. Prefer `unknown` or a more specific type.
20
+ - **Wrapper Objects:** Do not instantiate `String`, `Boolean`, or `Number` wrapper classes.
21
+ - **Automatic Semicolon Insertion (ASI):** Do not rely on it. **Explicitly end all statements with a semicolon.**
22
+ - **`const enum`:** Do not use `const enum`. Use plain `enum` instead.
23
+ - **`eval()` and `Function(...string)`:** Forbidden.
24
+
25
+ ## 3. Naming
26
+ - **`UpperCamelCase`:** For classes, interfaces, types, enums, and decorators.
27
+ - **`lowerCamelCase`:** For variables, parameters, functions, methods, and properties.
28
+ - **`CONSTANT_CASE`:** For global constant values, including enum values.
29
+ - **`_` Prefix/Suffix:** **Do not use `_` as a prefix or suffix** for identifiers, including for private properties.
30
+
31
+ ## 4. Type System
32
+ - **Type Inference:** Rely on type inference for simple, obvious types. Be explicit for complex types.
33
+ - **`undefined` and `null`:** Both are supported. Be consistent within your project.
34
+ - **Optional vs. `|undefined`:** Prefer optional parameters and fields (`?`) over adding `|undefined` to the type.
35
+ - **`Array<T>` Type:** Use `T[]` for simple types. Use `Array<T>` for more complex union types (e.g., `Array<string | number>`).
36
+ - **`{}` Type:** **Do not use `{}`**. Prefer `unknown`, `Record<string, unknown>`, or `object`.
37
+
38
+ ## 5. Comments and Documentation
39
+ - **JSDoc:** Use `/** JSDoc */` for documentation, `//` for implementation comments.
40
+ - **Redundancy:** **Do not declare types in `@param` or `@return` blocks** (e.g., `/** @param {string} user */`). This is redundant in TypeScript.
41
+ - **Add Information:** Comments must add information, not just restate the code.
42
+
43
+ *Source: [Google TypeScript Style Guide](https://google.github.io/styleguide/tsguide.html)*
@@ -0,0 +1,38 @@
1
+ # Vue.js Style Guide Summary
2
+
3
+ This document summarizes key rules and best practices from the official Vue.js Style Guide, specifically for Vue 3 and the Composition API.
4
+
5
+ ## 1. Component Files
6
+ - **Single File Components (SFC)**: Always use `.vue` files.
7
+ - **Naming**: Use `PascalCase` for component filenames (e.g., `TodoList.vue`).
8
+ - **Structure**: Follow the standard order: `<script setup>`, `<template>`, `<style>`.
9
+
10
+ ## 2. Component Data
11
+ - **Composition API**: Prefer `<script setup>` and the Composition API over the Options API.
12
+ - **Ref vs Reactive**: Use `ref()` for primitive values and `reactive()` for objects/arrays (or `ref()` consistently for both).
13
+ - **Props**:
14
+ - Use `defineProps` with TypeScript types.
15
+ - Props should be used for data passing only (unidirectional flow).
16
+
17
+ ## 3. Template Syntax
18
+ - **Directives**: Use shorthand for `v-bind` (`:`) and `v-on` (`@`).
19
+ - **Key Attribute**: Always use `:key` with `v-for`. Never use an index as a key if the list can change.
20
+ - **Computed Properties**: Use `computed()` for complex logic in templates. Never use method calls for data derived from other reactive state in templates.
21
+
22
+ ## 4. Lifecycle Hooks
23
+ - Use Composition API lifecycle hooks (e.g., `onMounted`, `onUnmounted`) within `setup`.
24
+ - Ensure listeners and timers are cleaned up in `onUnmounted`.
25
+
26
+ ## 5. Global State
27
+ - **Pinia**: Use Pinia for complex global state management.
28
+ - **Provide/Inject**: Use `provide`/`inject` for dependency injection across deeply nested components.
29
+
30
+ ## 6. Styling
31
+ - **Scoped Styles**: Use `<style scoped>` by default to prevent leaking styles.
32
+ - **CSS Variables**: Use reactive CSS variables via `v-bind()` in `<style>` blocks where appropriate.
33
+
34
+ ## 7. Directives & Events
35
+ - **Custom Directives**: Use sparingly. Prefer components for reusable logic.
36
+ - **Emit**: Use `defineEmits` for documenting and typed-checking events.
37
+
38
+ *Source: [Official Vue.js Style Guide](https://vuejs.org/style-guide/)*
@@ -0,0 +1,27 @@
1
+ # Zig Style Guide Summary
2
+
3
+ This document summarizes key rules and best practices for Zig development, based on the official Zig documentation and common community patterns.
4
+
5
+ ## 1. Naming Conventions
6
+ - **Functions**: `camelCase` (e.g., `initStack`).
7
+ - **Variables**: `camelCase` (e.g., `userCounter`).
8
+ - **Types (Structs, Enums, Unions)**: `PascalCase` (e.g., `MemoryPool`).
9
+ - **Files**: `snake_case.zig` (e.g., `array_list.zig`).
10
+ - **Constants**: `Screaming_Snake_Case` is avoided; prefer `camelCase` or `PascalCase` depending on if it's a value or a type.
11
+
12
+ ## 2. Formatting
13
+ - **Indentation**: 4 spaces.
14
+ - **Line Length**: 100 characters limit.
15
+ - **Braces**: Opening brace on the same line.
16
+
17
+ ## 3. Idiomatic Zig
18
+ - **Error Handling**: Use `error` sets and the `!` operator. Prefer `try` and `catch` for explicit error handling.
19
+ - **Memory Management**: Use `Allocator` explicitly. Avoid global allocators.
20
+ - **Comptime**: Use `comptime` for generic programming and compile-time logic.
21
+ - **Optionals**: Use `?T` for values that can be null. Use `if (maybe_value) |value|` to unwrap.
22
+
23
+ ## 4. Documentation
24
+ - Use `///` for doc comments.
25
+ - Use `//!` for top-level module documentation.
26
+
27
+ *Source: [Zig Documentation](https://ziglang.org/documentation/master/)*