Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 22, 2025

Created a concise style guide documenting coding standards, design patterns, and architectural conventions extracted from analyzing the existing codebase. Optimized for coding agents to minimize context window usage while preserving all essential information.

Changes

  • STYLE_GUIDE.md (183 lines): Condensed guide covering:

    • Code formatting (Prettier/TSLint configs with examples)
    • TypeScript patterns (strict typing, generic arrays Array<T>, explicit access modifiers)
    • React patterns (PureComponent, hooks, lazy loading, Material-UI withStyles)
    • Redux architecture (reducer/action patterns, thunk middleware)
    • File organization (component structure, naming conventions)
    • Testing (Mocha/Chai patterns)
    • Security practices (input validation, authentication)
    • Performance considerations (throttling, memoization)
  • Readme.md: Added style guide reference in development section

  • .github/copilot-instructions.md: Added style guide section at top for AI assistant reference

Example Conventions Documented

// Generic array syntax, explicit access modifiers
class MqttSource {
  private client: MqttClient
  public connect(options: MqttOptions): DataSourceStateMachine {
    // No semicolons, single quotes, 2-space indent
    const url = new URL(options.url)
    return this.stateMachine
  }
}

// PureComponent pattern with typed props
interface Props {
  connectionId: string
  actions: typeof globalActions
}

class App extends React.PureComponent<Props, {}> {
  public render() {
    return <div>{/* content */}</div>
  }
}

All conventions derived from actual codebase analysis (tsconfig, tslint, prettier configs, existing components, reducers, and test files). Format optimized for efficient consumption by coding agents with minimal verbosity.

Original prompt

Inspect the project and drive a style guide which can be used to streamline the design and create new features. Add a markdown file for it and link it in the readme and copilot instructions


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add style guide for design consistency and feature development Add comprehensive style guide with codebase-derived conventions Dec 22, 2025
@thomasnordquist
Copy link
Owner

@copilot make the Styleguide shorter, it is meant for coding agents and should not add noise to the context window

Copy link
Contributor Author

Copilot AI commented Dec 22, 2025

@copilot make the Styleguide shorter, it is meant for coding agents and should not add noise to the context window

Condensed the style guide from 890 to 183 lines (79% reduction). Removed verbose explanations and redundant examples while preserving all essential patterns and conventions. Commit: b7c6223

Copilot AI changed the title Add comprehensive style guide with codebase-derived conventions Add concise style guide optimized for coding agents Dec 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants