@forwardimpact/pathway 0.1.0 → 0.3.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 (140) hide show
  1. package/app/commands/agent.js +119 -31
  2. package/app/commands/command-factory.js +3 -3
  3. package/app/commands/interview.js +14 -7
  4. package/app/commands/job.js +52 -33
  5. package/app/commands/progress.js +14 -7
  6. package/app/commands/serve.js +5 -0
  7. package/app/commands/stage.js +0 -10
  8. package/app/commands/track.js +5 -8
  9. package/app/components/builder.js +117 -30
  10. package/app/css/components/surfaces.css +16 -0
  11. package/app/formatters/agent/profile.js +30 -115
  12. package/app/formatters/agent/skill.js +23 -44
  13. package/app/formatters/behaviour/dom.js +3 -0
  14. package/app/formatters/behaviour/microdata.js +106 -0
  15. package/app/formatters/discipline/dom.js +28 -1
  16. package/app/formatters/discipline/microdata.js +117 -0
  17. package/app/formatters/discipline/shared.js +49 -8
  18. package/app/formatters/driver/dom.js +3 -0
  19. package/app/formatters/driver/microdata.js +91 -0
  20. package/app/formatters/grade/dom.js +5 -4
  21. package/app/formatters/grade/microdata.js +151 -0
  22. package/app/formatters/index.js +32 -1
  23. package/app/formatters/interview/shared.js +13 -8
  24. package/app/formatters/job/description.js +70 -81
  25. package/app/formatters/job/dom.js +40 -113
  26. package/app/formatters/job/markdown.js +17 -13
  27. package/app/formatters/json-ld.js +242 -0
  28. package/app/formatters/microdata-shared.js +184 -0
  29. package/app/formatters/progress/shared.js +14 -11
  30. package/app/formatters/shared.js +7 -2
  31. package/app/formatters/skill/dom.js +3 -0
  32. package/app/formatters/skill/microdata.js +151 -0
  33. package/app/formatters/stage/dom.js +3 -18
  34. package/app/formatters/stage/microdata.js +110 -0
  35. package/app/formatters/stage/shared.js +0 -27
  36. package/app/formatters/track/dom.js +5 -30
  37. package/app/formatters/track/markdown.js +2 -25
  38. package/app/formatters/track/microdata.js +111 -0
  39. package/app/formatters/track/shared.js +6 -58
  40. package/app/handout-main.js +26 -12
  41. package/app/handout.html +7 -0
  42. package/app/index.html +11 -0
  43. package/app/lib/card-mappers.js +17 -12
  44. package/app/lib/form-controls.js +64 -1
  45. package/app/lib/job-cache.js +12 -9
  46. package/app/lib/render.js +8 -1
  47. package/app/lib/template-loader.js +75 -0
  48. package/app/lib/yaml-loader.js +25 -8
  49. package/app/main.js +8 -4
  50. package/app/model/agent.js +158 -130
  51. package/app/model/checklist.js +57 -91
  52. package/app/model/derivation.js +135 -68
  53. package/app/model/index-generator.js +1 -7
  54. package/app/model/job.js +19 -13
  55. package/app/model/levels.js +20 -12
  56. package/app/model/loader.js +41 -17
  57. package/app/model/matching.js +33 -3
  58. package/app/model/profile.js +38 -45
  59. package/app/model/schema-validation.js +438 -0
  60. package/app/model/validation.js +747 -68
  61. package/app/pages/agent-builder.js +125 -28
  62. package/app/pages/assessment-results.js +10 -4
  63. package/app/pages/discipline.js +36 -6
  64. package/app/pages/driver.js +9 -47
  65. package/app/pages/interview-builder.js +3 -1
  66. package/app/pages/interview.js +15 -4
  67. package/app/pages/job-builder.js +4 -1
  68. package/app/pages/job.js +43 -8
  69. package/app/pages/landing.js +10 -10
  70. package/app/pages/progress-builder.js +3 -1
  71. package/app/pages/progress.js +78 -26
  72. package/app/pages/self-assessment.js +3 -3
  73. package/app/pages/stage.js +3 -126
  74. package/app/slide-main.js +45 -17
  75. package/app/slides/index.js +3 -1
  76. package/app/slides/overview.js +40 -4
  77. package/app/slides/progress.js +4 -2
  78. package/app/slides.html +7 -0
  79. package/bin/pathway.js +28 -75
  80. package/examples/agents/.claude/skills/architecture-design/SKILL.md +58 -16
  81. package/examples/agents/.claude/skills/cloud-platforms/SKILL.md +59 -18
  82. package/examples/agents/.claude/skills/code-quality-review/SKILL.md +58 -17
  83. package/examples/agents/.claude/skills/devops-cicd/SKILL.md +64 -18
  84. package/examples/agents/.claude/skills/full-stack-development/SKILL.md +59 -15
  85. package/examples/agents/.claude/skills/sre-practices/SKILL.md +64 -18
  86. package/examples/agents/.claude/skills/technical-debt-management/SKILL.md +58 -17
  87. package/examples/agents/.github/agents/se-platform-code.agent.md +39 -88
  88. package/examples/agents/.github/agents/se-platform-plan.agent.md +41 -88
  89. package/examples/agents/.github/agents/se-platform-review.agent.md +38 -15
  90. package/examples/agents/.vscode/settings.json +1 -1
  91. package/examples/behaviours/outcome_ownership.yaml +1 -2
  92. package/examples/behaviours/polymathic_knowledge.yaml +1 -2
  93. package/examples/behaviours/precise_communication.yaml +1 -2
  94. package/examples/behaviours/relentless_curiosity.yaml +1 -2
  95. package/examples/behaviours/systems_thinking.yaml +1 -2
  96. package/examples/capabilities/business.yaml +80 -142
  97. package/examples/capabilities/delivery.yaml +155 -219
  98. package/examples/capabilities/people.yaml +2 -34
  99. package/examples/capabilities/reliability.yaml +161 -80
  100. package/examples/capabilities/scale.yaml +234 -252
  101. package/examples/copilot-setup-steps.yaml +25 -0
  102. package/examples/devcontainer.yaml +21 -0
  103. package/examples/disciplines/_index.yaml +1 -0
  104. package/examples/disciplines/data_engineering.yaml +14 -12
  105. package/examples/disciplines/engineering_management.yaml +63 -0
  106. package/examples/disciplines/software_engineering.yaml +14 -12
  107. package/examples/drivers.yaml +1 -4
  108. package/examples/framework.yaml +1 -2
  109. package/examples/grades.yaml +14 -15
  110. package/examples/questions/behaviours/outcome_ownership.yaml +1 -2
  111. package/examples/questions/behaviours/polymathic_knowledge.yaml +1 -2
  112. package/examples/questions/behaviours/precise_communication.yaml +1 -2
  113. package/examples/questions/behaviours/relentless_curiosity.yaml +1 -2
  114. package/examples/questions/behaviours/systems_thinking.yaml +1 -2
  115. package/examples/questions/skills/architecture_design.yaml +1 -2
  116. package/examples/questions/skills/cloud_platforms.yaml +1 -2
  117. package/examples/questions/skills/code_quality.yaml +1 -2
  118. package/examples/questions/skills/data_modeling.yaml +1 -2
  119. package/examples/questions/skills/devops.yaml +1 -2
  120. package/examples/questions/skills/full_stack_development.yaml +1 -2
  121. package/examples/questions/skills/sre_practices.yaml +1 -2
  122. package/examples/questions/skills/stakeholder_management.yaml +1 -2
  123. package/examples/questions/skills/team_collaboration.yaml +1 -2
  124. package/examples/questions/skills/technical_writing.yaml +1 -2
  125. package/examples/self-assessments.yaml +1 -3
  126. package/examples/stages.yaml +101 -46
  127. package/examples/tracks/_index.yaml +0 -1
  128. package/examples/tracks/platform.yaml +8 -13
  129. package/examples/tracks/sre.yaml +8 -18
  130. package/examples/vscode-settings.yaml +2 -7
  131. package/package.json +9 -3
  132. package/templates/agent.template.md +65 -0
  133. package/templates/job.template.md +47 -0
  134. package/templates/skill.template.md +28 -0
  135. package/examples/agents/.claude/skills/data-modeling/SKILL.md +0 -99
  136. package/examples/agents/.claude/skills/developer-experience/SKILL.md +0 -99
  137. package/examples/agents/.claude/skills/knowledge-management/SKILL.md +0 -100
  138. package/examples/agents/.claude/skills/pattern-generalization/SKILL.md +0 -102
  139. package/examples/agents/.claude/skills/technical-writing/SKILL.md +0 -129
  140. package/examples/tracks/manager.yaml +0 -53
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forwardimpact/pathway",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "Engineering Pathway framework for human and AI collaboration",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -25,7 +25,8 @@
25
25
  "files": [
26
26
  "bin/",
27
27
  "app/",
28
- "examples/"
28
+ "examples/",
29
+ "templates/"
29
30
  ],
30
31
  "exports": {
31
32
  ".": "./app/model/loader.js",
@@ -40,7 +41,7 @@
40
41
  "scripts": {
41
42
  "start": "node bin/pathway.js serve",
42
43
  "prestart": "npm run generate-index",
43
- "check": "npm run format && npm run lint && npm run test",
44
+ "check": "npm run format && npm run lint && npm run test && npm run validate:shacl",
44
45
  "check:fix": "npm run format:fix && npm run lint:fix",
45
46
  "lint": "eslint .",
46
47
  "lint:fix": "eslint . --fix",
@@ -49,17 +50,22 @@
49
50
  "test": "find ./tests -name '*.test.js' | xargs node --test",
50
51
  "test:e2e": "npx playwright test",
51
52
  "validate": "node bin/pathway.js --validate",
53
+ "validate:shacl": "node scripts/validate-shacl.js",
52
54
  "generate-index": "node bin/pathway.js --generate-index",
53
55
  "pathway": "node bin/pathway.js",
54
56
  "demo": "node scripts/demo.js"
55
57
  },
56
58
  "dependencies": {
59
+ "ajv": "^8.17.1",
60
+ "ajv-formats": "^3.0.1",
61
+ "mustache": "^4.2.0",
57
62
  "yaml": "^2.3.4"
58
63
  },
59
64
  "devDependencies": {
60
65
  "@playwright/test": "^1.49.0",
61
66
  "eslint": "^9.39.1",
62
67
  "eslint-config-prettier": "^10.1.8",
68
+ "n3": "^2.0.1",
63
69
  "prettier": "^3.7.4"
64
70
  },
65
71
  "engines": {
@@ -0,0 +1,65 @@
1
+ ---
2
+
3
+ {{#name}}name: {{name}} {{/name}}description: {{{description}}} {{#infer}}infer:
4
+ {{infer}} {{/infer}}{{#handoffs.length}}handoffs: {{#handoffs}} - label:
5
+ {{label}} {{#agent}} agent: {{agent}} {{/agent}} prompt: "{{{prompt}}}"
6
+ {{#send}} send: {{send}} {{/send}}{{/handoffs}}{{/handoffs.length}}---
7
+
8
+ # {{title}}
9
+
10
+ {{{stageDescription}}}
11
+
12
+ ## Core Identity
13
+
14
+ {{{identity}}}
15
+
16
+ {{#priority}} {{{priority}}}
17
+
18
+ {{/priority}} {{#capabilities.length}} Your primary capabilities:
19
+ {{#capabilities}}
20
+
21
+ - {{{.}}} {{/capabilities}}
22
+
23
+ {{/capabilities.length}} {{#beforeMakingChanges.length}} Before making changes:
24
+ {{#beforeMakingChanges}} {{index}}. {{{text}}} {{/beforeMakingChanges}}
25
+
26
+ {{/beforeMakingChanges.length}} {{#delegation}}
27
+
28
+ ## Delegation
29
+
30
+ {{{delegation}}}
31
+
32
+ {{/delegation}}
33
+
34
+ ## Operational Context
35
+
36
+ {{{operationalContext}}}
37
+
38
+ {{{workingStyle}}} {{#beforeHandoff}}
39
+
40
+ ## Before Handoff
41
+
42
+ Before offering a handoff, verify and summarize completion of these items:
43
+
44
+ {{{beforeHandoff}}}
45
+
46
+ When verified, summarize what was accomplished then offer the handoff. If items
47
+ are incomplete, explain what remains.
48
+
49
+ {{/beforeHandoff}}
50
+
51
+ ## Return Format
52
+
53
+ When completing work (for handoff or as a subagent), provide:
54
+
55
+ 1. **Work completed**: What was accomplished
56
+ 2. **Checklist status**: Items verified from Before Handoff section
57
+ 3. **Recommendation**: Ready for next stage, or needs more work
58
+
59
+ {{#constraints.length}}
60
+
61
+ ## Constraints
62
+
63
+ {{#constraints}}
64
+
65
+ - {{{.}}} {{/constraints}} {{/constraints.length}}
@@ -0,0 +1,47 @@
1
+ # {{title}}
2
+
3
+ - **Level:** {{gradeId}}
4
+ - **Experience:** {{typicalExperienceRange}}
5
+ {{#trackName}}- **Track:** {{trackName}}
6
+ {{/trackName}}
7
+
8
+ ## ROLE SUMMARY
9
+
10
+ {{{roleSummary}}}
11
+
12
+ {{#trackRoleContext}}
13
+ {{{trackRoleContext}}}
14
+
15
+ {{/trackRoleContext}}
16
+ {{#expectationsParagraph}}
17
+ {{{expectationsParagraph}}}
18
+
19
+ {{/expectationsParagraph}}
20
+
21
+ ## ROLE RESPONSIBILITIES
22
+
23
+ {{#responsibilities}}
24
+ - **{{capabilityName}}:** {{responsibility}}
25
+ {{/responsibilities}}
26
+
27
+ ## ROLE BEHAVIOURS
28
+
29
+ {{#behaviours}}
30
+ - **{{behaviourName}}:** {{maturityDescription}}
31
+ {{/behaviours}}
32
+
33
+ {{#skillLevels}}
34
+
35
+ ## {{levelHeading}}
36
+
37
+ {{#skills}}
38
+ - **{{skillName}}:** {{levelDescription}}
39
+ {{/skills}}
40
+
41
+ {{/skillLevels}}
42
+
43
+ ## QUALIFICATIONS
44
+
45
+ {{#qualificationSummary}}
46
+ {{{qualificationSummary}}}
47
+ {{/qualificationSummary}}
@@ -0,0 +1,28 @@
1
+ ---
2
+
3
+ name: {{name}} description: | {{#descriptionLines}} {{{.}}}
4
+ {{/descriptionLines}}---
5
+
6
+ # {{{title}}}
7
+
8
+ ## Stage Guidance
9
+
10
+ {{#stages}}
11
+
12
+ ### {{stageName}} Stage
13
+
14
+ **Focus:** {{{focus}}}
15
+
16
+ **Activities:** {{#activities}}
17
+
18
+ - {{{.}}} {{/activities}}
19
+
20
+ **Ready for {{nextStageName}} when:** {{#ready}}
21
+
22
+ - [ ] {{{.}}} {{/ready}}
23
+
24
+ {{/stages}} {{#reference}}
25
+
26
+ ## Reference
27
+
28
+ {{{reference}}} {{/reference}}
@@ -1,99 +0,0 @@
1
- ---
2
- name: data-modeling
3
- description: |
4
- Guide for designing database schemas, data structures, and data
5
- architectures. Use when designing tables, optimizing queries, or
6
- making decisions about data storage technologies.
7
- ---
8
-
9
- # Data Modeling
10
-
11
- ## When to use this skill
12
-
13
- Use this skill when:
14
-
15
- - Designing database schemas
16
- - Optimizing query performance
17
- - Choosing storage technologies
18
- - Planning schema migrations
19
- - Balancing normalization with performance
20
-
21
- ## Schema Design
22
-
23
- ### Normalization
24
-
25
- - **1NF**: Atomic values, no repeating groups
26
- - **2NF**: No partial dependencies
27
- - **3NF**: No transitive dependencies
28
- - Normalize first, then denormalize strategically
29
-
30
- ### Denormalization Trade-offs
31
-
32
- - Improves read performance
33
- - Complicates writes and updates
34
- - Risk of data inconsistency
35
- - Use for read-heavy workloads
36
-
37
- ## Data Store Selection
38
-
39
- ### Relational (SQL)
40
-
41
- - Strong consistency requirements
42
- - Complex queries and joins
43
- - ACID transactions needed
44
- - Well-defined schema
45
-
46
- ### Document (NoSQL)
47
-
48
- - Flexible, evolving schemas
49
- - Hierarchical data
50
- - Horizontal scaling priority
51
- - Read-heavy workloads
52
-
53
- ### Key-Value
54
-
55
- - Simple lookup patterns
56
- - Extreme performance needs
57
- - Caching layer
58
- - Session storage
59
-
60
- ### Time Series
61
-
62
- - Temporal data patterns
63
- - High write throughput
64
- - Time-based queries
65
- - Sensor and metrics data
66
-
67
- ## Indexing Strategy
68
-
69
- ### When to Index
70
-
71
- - Columns in WHERE clauses
72
- - Join columns
73
- - ORDER BY columns
74
- - High-cardinality columns
75
-
76
- ### Index Trade-offs
77
-
78
- - Faster reads, slower writes
79
- - Storage overhead
80
- - Maintenance cost
81
- - Query planner complexity
82
-
83
- ## Schema Migrations
84
-
85
- ### Safe Migration Practices
86
-
87
- - Make changes backward compatible
88
- - Add columns before using them
89
- - Migrate data before dropping columns
90
- - Test migrations on production-like data
91
-
92
- ## Data Modeling Checklist
93
-
94
- - [ ] Requirements understood
95
- - [ ] Appropriate storage technology selected
96
- - [ ] Schema normalized appropriately
97
- - [ ] Indexes support query patterns
98
- - [ ] Migration plan is safe
99
- - [ ] Backward compatibility maintained
@@ -1,99 +0,0 @@
1
- ---
2
- name: developer-experience
3
- description: |
4
- Guide for improving developer experience and creating self-service
5
- platforms. Use when designing golden paths, creating getting-started
6
- guides, reducing developer friction, or building internal platforms.
7
- ---
8
-
9
- # Developer Experience
10
-
11
- ## When to use this skill
12
-
13
- Use this skill when:
14
-
15
- - Designing developer onboarding experiences
16
- - Creating golden paths for common workflows
17
- - Building self-service platform capabilities
18
- - Reducing friction in developer workflows
19
- - Writing getting-started documentation
20
-
21
- ## Golden Path Design
22
-
23
- ### Principles
24
-
25
- - Opinionated but not restrictive
26
- - Works out of the box with minimal configuration
27
- - Covers 80% of use cases well
28
- - Easy to discover, hard to miss
29
-
30
- ### Components
31
-
32
- - **Templates**: Starter projects with best practices
33
- - **CLI tools**: Automate common tasks
34
- - **Documentation**: Clear, task-focused guides
35
- - **Examples**: Working code for common patterns
36
-
37
- ## Friction Log Process
38
-
39
- ### Observation
40
-
41
- 1. Shadow developers doing real tasks
42
- 2. Note every hesitation, confusion, or workaround
43
- 3. Time how long each step takes
44
- 4. Record what documentation they consult
45
-
46
- ### Analysis
47
-
48
- - Categorize friction points (tooling, docs, process)
49
- - Identify patterns across multiple observations
50
- - Prioritize by frequency × severity
51
- - Distinguish symptoms from root causes
52
-
53
- ### Action
54
-
55
- - Quick wins: Fix in days, high impact
56
- - Medium-term: Requires design, weeks
57
- - Strategic: Platform changes, months
58
-
59
- ## Self-Service Design
60
-
61
- ### Day 1 Experience
62
-
63
- - New developer can deploy in < 1 hour
64
- - No tickets or approvals needed
65
- - Immediate feedback on success/failure
66
- - Clear next steps after initial success
67
-
68
- ### Day 50 Experience
69
-
70
- - Common tasks are still easy
71
- - Edge cases are documented
72
- - Escape hatches exist for advanced needs
73
- - Platform grows with team needs
74
-
75
- ## Documentation Standards
76
-
77
- ### Getting Started Guides
78
-
79
- - Prerequisites clearly listed
80
- - Copy-paste commands that work
81
- - Expected output shown
82
- - Troubleshooting for common issues
83
-
84
- ### Reference Documentation
85
-
86
- - Complete API coverage
87
- - Examples for every feature
88
- - Search-friendly structure
89
- - Kept in sync with code
90
-
91
- ## DX Checklist
92
-
93
- - [ ] New developer can get started without help
94
- - [ ] Golden path covers common use cases
95
- - [ ] Friction points are documented and prioritized
96
- - [ ] Self-service for common operations
97
- - [ ] Documentation is discoverable and accurate
98
- - [ ] Feedback mechanisms exist
99
- - [ ] Metrics track developer productivity
@@ -1,100 +0,0 @@
1
- ---
2
- name: knowledge-management
3
- description: |
4
- Guide for capturing, organizing, and sharing organizational knowledge.
5
- Use when creating knowledge bases, organizing documentation, reducing
6
- knowledge silos, or establishing knowledge sharing practices.
7
- ---
8
-
9
- # Knowledge Management
10
-
11
- ## When to use this skill
12
-
13
- Use this skill when:
14
-
15
- - Creating or organizing knowledge bases
16
- - Documenting institutional knowledge
17
- - Reducing single-person dependencies
18
- - Establishing knowledge sharing practices
19
- - Making information discoverable
20
-
21
- ## Knowledge Capture
22
-
23
- ### What to Document
24
-
25
- - **Decisions**: Why we chose X over Y
26
- - **Context**: What we knew when we decided
27
- - **Procedures**: How to do recurring tasks
28
- - **Troubleshooting**: Common problems and solutions
29
- - **Architecture**: How systems work and why
30
-
31
- ### When to Capture
32
-
33
- - After making significant decisions
34
- - After solving novel problems
35
- - Before someone leaves or changes roles
36
- - When you explain something more than twice
37
- - During incident post-mortems
38
-
39
- ## Knowledge Organization
40
-
41
- ### Structure Principles
42
-
43
- - Organize by task, not by team
44
- - Use consistent naming conventions
45
- - Create clear navigation paths
46
- - Link related content together
47
- - Maintain a clear hierarchy
48
-
49
- ### Discoverability
50
-
51
- - Searchable titles and headings
52
- - Keywords and tags for filtering
53
- - Landing pages for major topics
54
- - Recently updated sections visible
55
- - Cross-linking between related docs
56
-
57
- ## Knowledge Maintenance
58
-
59
- ### Keep Current
60
-
61
- - Review docs when code changes
62
- - Date-stamp time-sensitive content
63
- - Archive rather than delete outdated info
64
- - Assign ownership for key documents
65
- - Schedule periodic review cycles
66
-
67
- ### Quality Standards
68
-
69
- - Clear ownership for each document
70
- - Last-updated dates visible
71
- - Contact for questions listed
72
- - Review schedule defined
73
- - Deprecation process documented
74
-
75
- ## Reducing Knowledge Silos
76
-
77
- ### Identify Risks
78
-
79
- - Single points of knowledge failure
80
- - Undocumented tribal knowledge
81
- - Expertise concentrated in individuals
82
- - Critical processes in one person's head
83
-
84
- ### Mitigation Strategies
85
-
86
- - Pair programming and shadowing
87
- - Recorded walkthroughs for complex systems
88
- - Cross-training sessions
89
- - Written runbooks for critical processes
90
- - Regular knowledge sharing meetings
91
-
92
- ## Knowledge Management Checklist
93
-
94
- - [ ] Key decisions are documented with rationale
95
- - [ ] Procedures are written and discoverable
96
- - [ ] No critical single-person dependencies
97
- - [ ] Documentation ownership is clear
98
- - [ ] Content is regularly reviewed and updated
99
- - [ ] New team members can self-serve information
100
- - [ ] Search finds relevant content quickly
@@ -1,102 +0,0 @@
1
- ---
2
- name: pattern-generalization
3
- description: |
4
- Guide for extracting reusable patterns from specific solutions. Use when
5
- identifying candidates for generalization, designing abstractions, or
6
- building platform capabilities from field-validated solutions.
7
- ---
8
-
9
- # Pattern Generalization
10
-
11
- ## When to use this skill
12
-
13
- Use this skill when:
14
-
15
- - Identifying solutions that could benefit other teams
16
- - Extracting reusable components from custom code
17
- - Designing abstractions for common patterns
18
- - Building platform capabilities from field solutions
19
- - Deciding when to generalize vs keep custom
20
-
21
- ## Generalization Criteria
22
-
23
- ### When to Generalize
24
-
25
- - Pattern appears in 3+ implementations
26
- - Solution has been validated in production
27
- - Multiple teams would benefit
28
- - Core logic is stable and understood
29
- - Customization needs are well-defined
30
-
31
- ### When to Keep Custom
32
-
33
- - Only one team needs it
34
- - Requirements are still evolving
35
- - Context is highly specific
36
- - Generalization cost exceeds benefit
37
- - Speed to market is critical
38
-
39
- ## Abstraction Design
40
-
41
- ### Principles
42
-
43
- - Solve the common case simply
44
- - Allow escape hatches for edge cases
45
- - Make the right thing easy, wrong thing possible
46
- - Prefer composition over configuration
47
- - Hide complexity, expose simplicity
48
-
49
- ### Trade-offs
50
-
51
- - **Flexibility vs Simplicity**: More options = more complexity
52
- - **Generality vs Performance**: Generic solutions may be slower
53
- - **Reusability vs Fit**: Shared code may not fit any use case perfectly
54
- - **Maintainability vs Features**: More features = more maintenance
55
-
56
- ## Extraction Process
57
-
58
- ### 1. Identify the Pattern
59
-
60
- - What's common across implementations?
61
- - What varies between uses?
62
- - What are the extension points?
63
- - What are the invariants?
64
-
65
- ### 2. Design the Interface
66
-
67
- - Start with the simplest API that works
68
- - Make common cases one-liners
69
- - Provide sensible defaults
70
- - Document customization options
71
-
72
- ### 3. Validate in New Context
73
-
74
- - Test with a different team/use case
75
- - Gather feedback on API usability
76
- - Identify missing flexibility
77
- - Refine based on real usage
78
-
79
- ### 4. Document and Publish
80
-
81
- - Clear getting-started guide
82
- - Examples for common patterns
83
- - Migration guide from custom solutions
84
- - Support and contribution process
85
-
86
- ## Generalization Anti-patterns
87
-
88
- - **Premature generalization**: Abstracting before understanding
89
- - **Kitchen sink**: Adding every possible feature
90
- - **Leaky abstraction**: Implementation details exposed
91
- - **Configuration overload**: Too many options to understand
92
- - **Orphaned abstraction**: No clear owner or support
93
-
94
- ## Pattern Generalization Checklist
95
-
96
- - [ ] Pattern validated in multiple contexts
97
- - [ ] Clear benefit over custom solutions
98
- - [ ] Simple API for common cases
99
- - [ ] Extension points for customization
100
- - [ ] Documentation and examples ready
101
- - [ ] Migration path from existing solutions
102
- - [ ] Ownership and support defined