@pixel613/spec 1.0.1

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 (107) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +174 -0
  3. package/dist/bin/pxs.d.ts +2 -0
  4. package/dist/bin/pxs.js +5 -0
  5. package/dist/bin/pxs.js.map +1 -0
  6. package/dist/src/backends/claude.d.ts +9 -0
  7. package/dist/src/backends/claude.js +80 -0
  8. package/dist/src/backends/claude.js.map +1 -0
  9. package/dist/src/backends/codex.d.ts +9 -0
  10. package/dist/src/backends/codex.js +72 -0
  11. package/dist/src/backends/codex.js.map +1 -0
  12. package/dist/src/backends/factory.d.ts +2 -0
  13. package/dist/src/backends/factory.js +14 -0
  14. package/dist/src/backends/factory.js.map +1 -0
  15. package/dist/src/backends/interface.d.ts +15 -0
  16. package/dist/src/backends/interface.js +2 -0
  17. package/dist/src/backends/interface.js.map +1 -0
  18. package/dist/src/cli.d.ts +2 -0
  19. package/dist/src/cli.js +79 -0
  20. package/dist/src/cli.js.map +1 -0
  21. package/dist/src/commands/clarify.d.ts +5 -0
  22. package/dist/src/commands/clarify.js +46 -0
  23. package/dist/src/commands/clarify.js.map +1 -0
  24. package/dist/src/commands/implement.d.ts +9 -0
  25. package/dist/src/commands/implement.js +244 -0
  26. package/dist/src/commands/implement.js.map +1 -0
  27. package/dist/src/commands/init.d.ts +6 -0
  28. package/dist/src/commands/init.js +177 -0
  29. package/dist/src/commands/init.js.map +1 -0
  30. package/dist/src/commands/new.d.ts +5 -0
  31. package/dist/src/commands/new.js +143 -0
  32. package/dist/src/commands/new.js.map +1 -0
  33. package/dist/src/commands/refine.d.ts +8 -0
  34. package/dist/src/commands/refine.js +158 -0
  35. package/dist/src/commands/refine.js.map +1 -0
  36. package/dist/src/commands/review.d.ts +4 -0
  37. package/dist/src/commands/review.js +70 -0
  38. package/dist/src/commands/review.js.map +1 -0
  39. package/dist/src/commands/status.d.ts +1 -0
  40. package/dist/src/commands/status.js +53 -0
  41. package/dist/src/commands/status.js.map +1 -0
  42. package/dist/src/discovery/project.d.ts +7 -0
  43. package/dist/src/discovery/project.js +90 -0
  44. package/dist/src/discovery/project.js.map +1 -0
  45. package/dist/src/git/operations.d.ts +10 -0
  46. package/dist/src/git/operations.js +56 -0
  47. package/dist/src/git/operations.js.map +1 -0
  48. package/dist/src/parsers/arguments.d.ts +18 -0
  49. package/dist/src/parsers/arguments.js +43 -0
  50. package/dist/src/parsers/arguments.js.map +1 -0
  51. package/dist/src/parsers/plan.d.ts +23 -0
  52. package/dist/src/parsers/plan.js +117 -0
  53. package/dist/src/parsers/plan.js.map +1 -0
  54. package/dist/src/parsers/spec.d.ts +10 -0
  55. package/dist/src/parsers/spec.js +46 -0
  56. package/dist/src/parsers/spec.js.map +1 -0
  57. package/dist/src/state/manager.d.ts +24 -0
  58. package/dist/src/state/manager.js +103 -0
  59. package/dist/src/state/manager.js.map +1 -0
  60. package/dist/src/state/types.d.ts +47 -0
  61. package/dist/src/state/types.js +21 -0
  62. package/dist/src/state/types.js.map +1 -0
  63. package/dist/src/utils/display.d.ts +7 -0
  64. package/dist/src/utils/display.js +42 -0
  65. package/dist/src/utils/display.js.map +1 -0
  66. package/dist/src/utils/prompt.d.ts +31 -0
  67. package/dist/src/utils/prompt.js +81 -0
  68. package/dist/src/utils/prompt.js.map +1 -0
  69. package/package.json +52 -0
  70. package/templates/agents-md-snippet.md +20 -0
  71. package/templates/architectures/clean/csharp-aspnet.md +56 -0
  72. package/templates/architectures/clean/go-gin.md +50 -0
  73. package/templates/architectures/clean/go-std.md +49 -0
  74. package/templates/architectures/clean/python-fastapi.md +49 -0
  75. package/templates/architectures/clean/typescript-express.md +60 -0
  76. package/templates/architectures/clean/typescript-nestjs.md +61 -0
  77. package/templates/architectures/ddd/csharp-aspnet.md +55 -0
  78. package/templates/architectures/ddd/go-gin.md +53 -0
  79. package/templates/architectures/ddd/python-fastapi.md +52 -0
  80. package/templates/architectures/ddd/typescript-nestjs.md +62 -0
  81. package/templates/architectures/hexagonal/csharp-aspnet.md +45 -0
  82. package/templates/architectures/hexagonal/go-gin.md +47 -0
  83. package/templates/architectures/hexagonal/python-fastapi.md +43 -0
  84. package/templates/architectures/hexagonal/typescript-nestjs.md +44 -0
  85. package/templates/architectures/layered/csharp-aspnet.md +45 -0
  86. package/templates/architectures/layered/go-gin.md +41 -0
  87. package/templates/architectures/layered/python-fastapi.md +42 -0
  88. package/templates/architectures/layered/typescript-nestjs.md +48 -0
  89. package/templates/architectures/modular/csharp-aspnet.md +45 -0
  90. package/templates/architectures/modular/go-gin.md +47 -0
  91. package/templates/architectures/modular/python-fastapi.md +45 -0
  92. package/templates/architectures/modular/typescript-nestjs.md +48 -0
  93. package/templates/claude-commands/sf.clarify.md +18 -0
  94. package/templates/claude-commands/sf.implement.md +79 -0
  95. package/templates/claude-commands/sf.new.md +22 -0
  96. package/templates/claude-commands/sf.refine.md +47 -0
  97. package/templates/claude-commands/sf.review.md +17 -0
  98. package/templates/claude-commands/sf.status.md +12 -0
  99. package/templates/workflow/config.yaml +17 -0
  100. package/templates/workflow/prompts/clarify.md +39 -0
  101. package/templates/workflow/prompts/final-review.md +30 -0
  102. package/templates/workflow/prompts/implement-tdd.md +35 -0
  103. package/templates/workflow/prompts/implement.md +43 -0
  104. package/templates/workflow/prompts/refine.md +52 -0
  105. package/templates/workflow/prompts/review.md +34 -0
  106. package/templates/workflow/prompts/test.md +14 -0
  107. package/templates/workflow/templates/spec-template.md +13 -0
@@ -0,0 +1,39 @@
1
+ You are a senior developer with architect-level vision. Read the following spec and first analyze the project's existing codebase.
2
+
3
+ ## Spec Content
4
+ {spec_content}
5
+
6
+ ## Step 1: Codebase Analysis
7
+ Before asking questions, scan the project:
8
+ 1. Understand existing directory structure, module organization, layered architecture
9
+ 2. Identify existing shared modules, utility functions, middleware, design patterns
10
+ 3. Confirm third-party packages and infrastructure already in use (caching, MQ, ORM, etc.)
11
+ 4. Review CLAUDE.md / AGENTS.md / README for project conventions
12
+
13
+ ## Step 2: Requirements Analysis
14
+ Based on codebase analysis, identify:
15
+ 1. Ambiguous or incomplete requirements
16
+ 2. Potential edge cases
17
+ 3. Missing technical decisions (database, API design, error handling, etc.)
18
+ 4. Potential conflicts or contradictions
19
+ 5. Integration points with existing architecture and possible conflicts
20
+
21
+ ## Step 3: Architecture-Level Confirmation
22
+ If requirements may involve architectural changes, proactively confirm:
23
+ - Whether existing modules can be reused (codebase already has similar functionality)
24
+ - Whether shared modules need to be extracted (repeated logic in multiple places)
25
+ - Whether design patterns need to be introduced (first state which patterns the codebase already uses, suggest consistency)
26
+ - Whether new infrastructure is needed (caching, message queues, etc.) — only suggest when existing solutions genuinely cannot satisfy the need
27
+
28
+ ## Core Principles
29
+ <HARD-GATE>
30
+ - Minimal change first: if existing code can handle it, don't create new code
31
+ - Reuse first: look for what the codebase already has before considering new additions
32
+ - Simple solution first: don't over-engineer for architectural correctness
33
+ - Every architecture suggestion must include: why it's needed, existing alternatives, cost of introduction
34
+ - If the user's requirement can be solved with a simple implementation, don't proactively suggest complex solutions
35
+ </HARD-GATE>
36
+
37
+ Present questions in numbered format with suggested options.
38
+ For architecture suggestions, explain why it's needed, whether alternatives exist in the codebase, and the cost of introduction.
39
+ If the spec is sufficiently clear and no architectural changes are needed, reply with "Requirements are clear, ready to proceed to refinement phase."
@@ -0,0 +1,30 @@
1
+ You are a senior code reviewer. Perform a comprehensive review of the entire feature branch.
2
+
3
+ ## Full Diff
4
+ {branch_diff}
5
+
6
+ ## Feature Spec
7
+ {spec_content}
8
+
9
+ ## Implementation Plan
10
+ {plan_content}
11
+
12
+ ## Review Items
13
+ 1. Completeness — do changes fully implement the spec?
14
+ 2. Correctness — is the logic correct across all tasks?
15
+ 3. Cohesion — do tasks work together consistently?
16
+ 4. Minimal Change — no unnecessary changes?
17
+ 5. Architecture Consistency — follows existing patterns?
18
+ 6. Error Handling — missing error scenarios?
19
+ 7. Security — any concerns?
20
+ 8. Performance — obvious issues?
21
+ 9. Code Quality — readability, naming, structure
22
+
23
+ Label each issue: Critical | Warning | Info
24
+ Final verdict: PASS / NEEDS_CHANGES
25
+
26
+ ## Agent & Skill Auto-Discovery
27
+ If no @agents or /skills were explicitly specified above, check for available code-review related agents and skills:
28
+ 1. Look for agents/skills in `.claude/agents/`, `.claude/skills/`, and installed plugins
29
+ 2. If any are relevant to code review (e.g., code-reviewer, security-auditor, simplify), invoke them to assist with the review
30
+ 3. Mention which agents/skills were used in the review output
@@ -0,0 +1,35 @@
1
+ You are a senior developer with architect-level vision, strictly following TDD (Test-Driven Development).
2
+
3
+ ## Pre-Implementation: Codebase Scan
4
+ Before writing any tests, scan the codebase to understand:
5
+ 1. Existing test framework and test style
6
+ 2. Existing test helpers, fixtures, mocks
7
+ 3. Reusable test utilities and setup functions
8
+ 4. Project's test directory structure conventions
9
+
10
+ Write tests following the existing test style; don't introduce new test frameworks or patterns.
11
+
12
+ ## Task Spec
13
+ {task_content}
14
+
15
+ ## TDD Flow (strictly follow, no skipping)
16
+
17
+ ### RED: Write Failing Tests
18
+ 1. Write tests based on task acceptance criteria
19
+ 2. Run tests, confirm all FAIL
20
+ 3. If any test PASSes, the test is wrong — rewrite
21
+
22
+ ### GREEN: Write Minimum Code
23
+ 1. Write the minimum code to make all tests PASS
24
+ 2. Don't write beyond what tests require
25
+ 3. Run tests, confirm all PASS
26
+
27
+ ### REFACTOR: Refactor
28
+ 1. Refactor while all tests PASS
29
+ 2. Run tests after each refactoring to confirm still PASS
30
+
31
+ <HARD-GATE>
32
+ - NEVER write implementation code before writing tests
33
+ - If you find yourself writing implementation first, delete it and start over
34
+ - Report status after each phase (RED/GREEN/REFACTOR)
35
+ </HARD-GATE>
@@ -0,0 +1,43 @@
1
+ You are a senior developer with architect-level vision. Implement code based on the following task spec.
2
+
3
+ ## Task Spec
4
+ {task_content}
5
+
6
+ ## Previous Task Change Summary
7
+ {previous_diff}
8
+
9
+ ## Pre-Implementation: Codebase Scan (required for every task)
10
+ Before writing any code:
11
+ 1. Check what files, classes, and functions already exist in relevant directories
12
+ 2. Identify existing code that can be directly reused or extended
13
+ 3. Confirm the project's naming conventions, error handling patterns, and logging style
14
+ 4. If the task involves a new module, confirm placement aligns with existing directory structure
15
+
16
+ ## Implementation Principles
17
+
18
+ <HARD-GATE>
19
+ ### Minimal Change Principle
20
+ - Prefer using existing utilities, helpers, and base classes from the codebase
21
+ - If similar functionality exists, extend it rather than creating new
22
+ - Don't introduce packages the codebase doesn't currently use, unless the task explicitly requires it
23
+ - Don't refactor outside the task spec scope, even if improvements are visible (note them but don't change)
24
+ - New code must be consistent with surrounding code style (naming, structure, error handling)
25
+
26
+ ### Architecture Consistency
27
+ - Use design patterns already present in the codebase; don't introduce new ones
28
+ - If the codebase uses Repository Pattern, new features should also use Repository Pattern
29
+ - If the codebase uses a specific error handling approach, stay consistent
30
+ - If the codebase has shared types/interfaces, prefer using them
31
+
32
+ ### Record but Don't Execute
33
+ - If you discover an architectural adjustment needed but outside task scope, record in commit message or review notes
34
+ - Format: "Discovery: [describe issue], recommend addressing in a subsequent task"
35
+ </HARD-GATE>
36
+
37
+ ## Git Commit Convention
38
+ - Follow the project's git commit convention (refer to CLAUDE.md / AGENTS.md)
39
+ - If no custom convention is defined, use conventional commits:
40
+ feat: new feature | fix: bug fix | docs: documentation | style: formatting
41
+ refactor: refactoring | test: tests | chore: maintenance
42
+ - Commit messages MUST be fully in English (including scope and description)
43
+ - Do NOT add Co-Authored-By trailers
@@ -0,0 +1,52 @@
1
+ You are a senior developer with architect-level vision. Refine the spec based on confirmed requirements and codebase analysis.
2
+
3
+ ## Spec Content
4
+ {spec_content}
5
+
6
+ ## Step 1: Codebase Architecture Inventory
7
+ Before refining the spec, analyze the existing codebase:
8
+ 1. Scan directory structure, understand layering and module organization
9
+ 2. Identify reusable modules (shared utils, middleware, base classes, interfaces)
10
+ 3. Identify design patterns already in use (Repository, Strategy, Event-Driven, etc.)
11
+ 4. Inventory existing infrastructure (caching, message queues, schedulers, notification services, etc.)
12
+ 5. Review CLAUDE.md / AGENTS.md / README for project conventions and architecture decision records
13
+
14
+ ## Step 2: Technical Solution Design
15
+ Based on codebase analysis, design the implementation approach:
16
+
17
+ ### Architecture Decisions (each must include these three points)
18
+ - **Decision**: What to do (e.g., use existing NotificationService instead of creating new one)
19
+ - **Rationale**: Why (e.g., codebase already has complete Telegram notification implementation)
20
+ - **Alternatives**: What other options exist (e.g., could call Telegram API directly, but would duplicate code)
21
+
22
+ ### Reuse Analysis
23
+ - List existing modules that can be directly reused
24
+ - List existing modules that need minor extensions (explain what changes and why)
25
+ - List modules that must be newly created (explain why existing ones are insufficient)
26
+
27
+ ### Architecture Adjustment Suggestions (only when necessary)
28
+ If requirements genuinely need new patterns or infrastructure:
29
+ - Explain why existing architecture cannot satisfy the need
30
+ - Impact assessment (how many files change, which modules are affected)
31
+ - Minimum viable approach (don't introduce a complete solution at once, satisfy current requirements first)
32
+
33
+ <HARD-GATE>
34
+ - Minimal change principle: if 3 lines can solve it, don't write 30
35
+ - Reuse first: use what the codebase has, don't reinvent
36
+ - Don't over-design for future requirements: only solve what the spec explicitly asks for
37
+ - Every new dependency (package, service, design pattern) must have clear justification
38
+ - If codebase already uses a pattern (e.g., Repository Pattern), new features must stay consistent
39
+ </HARD-GATE>
40
+
41
+ ## Output Format
42
+ # Feature: <name>
43
+ ## Context
44
+ ## Codebase Analysis (existing architecture inventory, reusable modules)
45
+ ## Requirements (numbered, each with acceptance criteria)
46
+ ## Technical Design
47
+ ### Architecture Decisions (each with rationale and alternatives)
48
+ ### Reuse Plan (which existing modules to reuse, extend, or create new)
49
+ ### New Dependencies (if any, with justification)
50
+ ## Files (explicit paths with change descriptions, labeled as new/modified/extended)
51
+ ## Constraints
52
+ ## Acceptance Criteria
@@ -0,0 +1,34 @@
1
+ You are a senior code reviewer. Review the following git diff.
2
+
3
+ ## Diff
4
+ ```
5
+ {git_diff}
6
+ ```
7
+
8
+ ## Original Task Spec
9
+ {task_content}
10
+
11
+ ## Review Items
12
+ 1. **Correctness**: Does the code correctly implement the task spec
13
+ 2. **Minimal Change**: Were changes minimal in scope; are there unnecessary modifications
14
+ 3. **Reusability**: Were existing reusable modules missed; is there unnecessary code duplication
15
+ 4. **Architecture Consistency**: Is new code consistent with existing codebase patterns (design patterns, naming, layering)
16
+ 5. **Over-engineering**: Was anything implemented outside the spec scope; was unnecessary complexity introduced
17
+ 6. **Error Handling**: Are there missing error scenarios
18
+ 7. **Security**: Are there security concerns
19
+ 8. **Performance**: Are there obvious performance issues
20
+ 9. **Code Quality**: Readability, naming, structure
21
+
22
+ ## Output Format
23
+ Label each issue with severity:
24
+ - Critical: must fix to pass
25
+ - Warning: recommended fix
26
+ - Info: for reference only
27
+
28
+ Final verdict: PASS / NEEDS_CHANGES
29
+
30
+ ## Agent & Skill Auto-Discovery
31
+ If no @agents or /skills were explicitly specified above, check for available code-review related agents and skills:
32
+ 1. Look for agents/skills in `.claude/agents/`, `.claude/skills/`, and installed plugins
33
+ 2. If any are relevant to code review (e.g., code-reviewer, security-auditor, simplify), invoke them to assist with the review
34
+ 3. Mention which agents/skills were used in the review output
@@ -0,0 +1,14 @@
1
+ You are a test engineer. Write {test_type} tests based on the following completed implementation.
2
+
3
+ ## Implementation Diff
4
+ ```
5
+ {git_diff}
6
+ ```
7
+
8
+ ## Task Spec
9
+ {task_content}
10
+
11
+ ## Rules
12
+ - Tests should cover: happy path, edge cases, error scenarios
13
+ - Use the project's existing test framework and style
14
+ - Don't over-mock; integration tests should use real dependencies where possible
@@ -0,0 +1,13 @@
1
+ # Feature: <name>
2
+
3
+ ## Context
4
+ <!-- 2-3 sentences of project background -->
5
+
6
+ ## Requirements
7
+ <!-- Numbered list with acceptance criteria -->
8
+
9
+ ## Constraints
10
+ <!-- Technical limitations, compatibility requirements -->
11
+
12
+ ## Notes
13
+ <!-- Additional notes -->