agentic-code 0.5.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.
- package/.agents/context-maps/task-rule-matrix.yaml +248 -0
- package/.agents/rules/contextual/architecture/implementation-approach.md +202 -0
- package/.agents/rules/core/ai-development-guide.md +272 -0
- package/.agents/rules/core/documentation-criteria.md +184 -0
- package/.agents/rules/core/integration-e2e-testing.md +76 -0
- package/.agents/rules/core/metacognition.md +153 -0
- package/.agents/rules/core/testing-strategy.md +230 -0
- package/.agents/rules/language/general/rules.md +117 -0
- package/.agents/rules/language/general/testing.md +257 -0
- package/.agents/rules/language/typescript/rules.md +178 -0
- package/.agents/rules/language/typescript/testing.md +284 -0
- package/.agents/tasks/acceptance-test-generation.md +461 -0
- package/.agents/tasks/code-review.md +207 -0
- package/.agents/tasks/implementation.md +199 -0
- package/.agents/tasks/integration-test-review.md +132 -0
- package/.agents/tasks/prd-creation.md +336 -0
- package/.agents/tasks/quality-assurance.md +219 -0
- package/.agents/tasks/task-analysis.md +263 -0
- package/.agents/tasks/technical-design.md +432 -0
- package/.agents/tasks/technical-document-review.md +254 -0
- package/.agents/tasks/work-planning.md +239 -0
- package/.agents/workflows/agentic-coding.md +333 -0
- package/AGENTS.md +156 -0
- package/LICENSE +21 -0
- package/README.md +268 -0
- package/bin/cli.js +117 -0
- package/package.json +45 -0
- package/scripts/setup.js +82 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
## ABSOLUTE PRINCIPLES
|
|
4
|
+
|
|
5
|
+
1. **EXECUTE all rules and requirements in task/rule files - no exceptions**
|
|
6
|
+
2. **COMPLETE all entry and exit conditions for every task**
|
|
7
|
+
3. **STOP at gates - proceed only when conditions are met**
|
|
8
|
+
|
|
9
|
+
## Initial Setup [FIRST TIME ONLY]
|
|
10
|
+
|
|
11
|
+
**Complete before any other operation:**
|
|
12
|
+
1. Execute `date` command ā Store as SESSION_BASELINE_DATE
|
|
13
|
+
2. Apply `.agents/rules/core/metacognition.md` ā Keep active entire session
|
|
14
|
+
3. Use SESSION_BASELINE_DATE for all date references (WebSearch, docs, etc.)
|
|
15
|
+
4. Verify project structure with `ls -la`
|
|
16
|
+
|
|
17
|
+
## Core Execution Principle
|
|
18
|
+
|
|
19
|
+
**Universal Entry Point**: Every request starts with task-analysis.md to determine the appropriate path.
|
|
20
|
+
|
|
21
|
+
## Task Analysis - Required First Step
|
|
22
|
+
|
|
23
|
+
**ALWAYS start here for any user request:**
|
|
24
|
+
1. Apply `.agents/tasks/task-analysis.md`
|
|
25
|
+
2. Follow its output to select the appropriate path:
|
|
26
|
+
|
|
27
|
+
### Path Selection Based on Task Analysis
|
|
28
|
+
|
|
29
|
+
**Small Scale (1-2 files) / Single Task:**
|
|
30
|
+
- Load specific task definition (e.g., implementation.md, technical-design.md)
|
|
31
|
+
- Execute that task definition directly
|
|
32
|
+
- No workflow needed
|
|
33
|
+
|
|
34
|
+
**Medium/Large Scale (3+ files) / Complex Task:**
|
|
35
|
+
- Follow task-analysis.md recommendation for workflow selection
|
|
36
|
+
|
|
37
|
+
## Core Principles
|
|
38
|
+
|
|
39
|
+
### Plan Injection [MANDATORY ENFORCEMENT]
|
|
40
|
+
**All tasks require Plan Injection for BLOCKING READs:**
|
|
41
|
+
- Task-analysis.md Step 8 scans and identifies ALL BLOCKING READ requirements
|
|
42
|
+
- Work plans MUST contain every BLOCKING READ from workflow/tasks/rules
|
|
43
|
+
- Each phase verifies its BLOCKING READs are in the plan
|
|
44
|
+
- Gates verify Plan Injection evidence before proceeding
|
|
45
|
+
- Missing ANY BLOCKING READ = IMMEDIATE HALT
|
|
46
|
+
|
|
47
|
+
### Task Definition Loading
|
|
48
|
+
**Task definitions define WHAT to build - never skip them:**
|
|
49
|
+
- Verify entry gates before proceeding
|
|
50
|
+
- Follow Required Rules section in each task definition
|
|
51
|
+
|
|
52
|
+
### Rule Application
|
|
53
|
+
**Apply rules based on task type from task-analysis:**
|
|
54
|
+
- Rules are loaded progressively as needed
|
|
55
|
+
- Each task definition specifies its required rules
|
|
56
|
+
- Unload task-specific rules after completion
|
|
57
|
+
|
|
58
|
+
### Quality Standards
|
|
59
|
+
**Before marking any task complete:**
|
|
60
|
+
- All tests pass (when applicable)
|
|
61
|
+
- All quality checks return 0 errors
|
|
62
|
+
- Task exit conditions are satisfied
|
|
63
|
+
- Work documented as needed
|
|
64
|
+
|
|
65
|
+
## Approval Points
|
|
66
|
+
|
|
67
|
+
**Principle**: Get user approval at significant milestones.
|
|
68
|
+
|
|
69
|
+
Common approval points:
|
|
70
|
+
- When recommending a workflow for Medium/Large tasks
|
|
71
|
+
- After creating design or decision documents
|
|
72
|
+
- When technical approach changes significantly
|
|
73
|
+
- At task definition specified stop points
|
|
74
|
+
|
|
75
|
+
**VIOLATIONS TO PREVENT:**
|
|
76
|
+
- Work plan without ALL BLOCKING READs = RETURN TO TASK ANALYSIS
|
|
77
|
+
- Skipping ANY BLOCKING READ = IMMEDIATE HALT
|
|
78
|
+
- Proceeding without task definition compliance = BLOCKING ERROR
|
|
79
|
+
|
|
80
|
+
## Quality Standards
|
|
81
|
+
|
|
82
|
+
**Universal quality requirements:**
|
|
83
|
+
- Follow TDD process for all code changes
|
|
84
|
+
- All quality checks must pass with 0 errors
|
|
85
|
+
- Follow standards defined in language-specific rules
|
|
86
|
+
- Each task definition specifies its quality gates
|
|
87
|
+
|
|
88
|
+
## Metacognition Checkpoints
|
|
89
|
+
|
|
90
|
+
Perform self-assessment at these mandatory points:
|
|
91
|
+
- Task type changes
|
|
92
|
+
- Unexpected errors occur
|
|
93
|
+
- Completing a meaningful unit of work
|
|
94
|
+
- Before starting new implementation
|
|
95
|
+
- After completing each task from work plan
|
|
96
|
+
|
|
97
|
+
## Context Management
|
|
98
|
+
|
|
99
|
+
**Guidelines**:
|
|
100
|
+
- Load rules progressively, not all at once
|
|
101
|
+
- Unload task-specific rules after completion
|
|
102
|
+
- Keep only frequently-used rules loaded
|
|
103
|
+
- If context feels constrained, ask user for cleanup guidance
|
|
104
|
+
|
|
105
|
+
## Error Recovery
|
|
106
|
+
|
|
107
|
+
When stuck or encountering errors:
|
|
108
|
+
1. Re-read current task definition
|
|
109
|
+
2. Check if required rules are loaded
|
|
110
|
+
3. Look for anti-patterns in ai-development-guide.md
|
|
111
|
+
4. If unable to resolve, ask user for clarification
|
|
112
|
+
|
|
113
|
+
## File Organization
|
|
114
|
+
|
|
115
|
+
**Tasks** (.agents/tasks/):
|
|
116
|
+
- task-analysis.md: **Entry point**
|
|
117
|
+
- work-planning.md: Create work plans
|
|
118
|
+
- technical-design.md: Design documentation
|
|
119
|
+
- acceptance-test-generation.md: Test skeleton generation
|
|
120
|
+
- implementation.md: Implementation guidelines
|
|
121
|
+
- quality-assurance.md: Quality standards
|
|
122
|
+
|
|
123
|
+
**Workflows** (.agents/workflows/):
|
|
124
|
+
- agentic-coding.md: Medium/Large scale workflow
|
|
125
|
+
|
|
126
|
+
**Context Maps** (.agents/context-maps/):
|
|
127
|
+
- task-rule-matrix.yaml: Task-to-rule mappings
|
|
128
|
+
|
|
129
|
+
**Core Rules** (.agents/rules/core/):
|
|
130
|
+
- metacognition.md: Self-assessment
|
|
131
|
+
- ai-development-guide.md: Anti-patterns
|
|
132
|
+
- documentation-criteria.md: Documentation criteria
|
|
133
|
+
|
|
134
|
+
**Language Rules** (.agents/rules/language/):
|
|
135
|
+
- rules.md: Development rules
|
|
136
|
+
- testing.md: Testing standards
|
|
137
|
+
|
|
138
|
+
**Contextual Rules** (.agents/rules/contextual/):
|
|
139
|
+
- architecture/: Implementation approaches
|
|
140
|
+
|
|
141
|
+
## Anti-Patterns to Avoid
|
|
142
|
+
|
|
143
|
+
1. **Skipping task-analysis.md** ā ALWAYS start with task analysis
|
|
144
|
+
2. **Loading all rules upfront** ā Load progressively based on task needs
|
|
145
|
+
3. **Ignoring task entry/exit conditions** ā Verify gates at each step
|
|
146
|
+
4. **Working without task definitions** ā Task definitions define WHAT to build
|
|
147
|
+
6. **Assuming workflow is always needed** ā Small tasks can use direct task definitions
|
|
148
|
+
7. **Premature workflow selection** ā Let task-analysis determine the approach
|
|
149
|
+
|
|
150
|
+
## Success Metrics
|
|
151
|
+
|
|
152
|
+
Track internally:
|
|
153
|
+
- Task completion rate
|
|
154
|
+
- Rules actually used vs loaded
|
|
155
|
+
- Quality checks passing rate (should be 100%)
|
|
156
|
+
- Appropriate path selection (direct vs workflow)
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Shinsuke Kagawa
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
# Agentic Code
|
|
2
|
+
|
|
3
|
+
Your AI (LLM), guided by built-in workflows. Describe what you want, and it follows a professional development process.
|
|
4
|
+
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](https://agents.md)
|
|
7
|
+
[](package.json)
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
*AI builds a Slack bot with tests & docs ā in 30s*
|
|
12
|
+
|
|
13
|
+
## What You Get
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
You: "Build a Slack bot with Gemini API"
|
|
17
|
+
AI: ā Reads AGENTS.md
|
|
18
|
+
ā Analyzes requirements
|
|
19
|
+
ā Plans architecture
|
|
20
|
+
ā Writes tests first
|
|
21
|
+
ā Implements with best practices
|
|
22
|
+
ā Verifies everything works
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**Works out of the boxāno configuration or learning curve required.**
|
|
26
|
+
|
|
27
|
+
> **Using Claude Code with TypeScript?**
|
|
28
|
+
> Check out **[AI Coding Project Boilerplate](https://github.com/shinpr/ai-coding-project-boilerplate)** - a specialized alternative optimized for that specific stack.
|
|
29
|
+
|
|
30
|
+
## Quick Start (30 seconds)
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx agentic-code my-project && cd my-project
|
|
34
|
+
# Ready to go
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
That's it. Works with **any AI tool** - Codex, Cursor, Aider, or anything [AGENTS.md](https://agents.md) compatible.
|
|
38
|
+
|
|
39
|
+
## Why This Exists
|
|
40
|
+
|
|
41
|
+
Every AI coding tool has the same problems:
|
|
42
|
+
- Forgets your project structure after 10 messages
|
|
43
|
+
- Deletes tests when adding features
|
|
44
|
+
- Ignores architectural decisions
|
|
45
|
+
- Skips quality checks
|
|
46
|
+
|
|
47
|
+
**We built the solution into the framework.** AGENTS.md guides your AI through professional workflows automatically.
|
|
48
|
+
|
|
49
|
+
## What Makes It Different
|
|
50
|
+
|
|
51
|
+
### šÆ **Zero Configuration**
|
|
52
|
+
Pre-built workflows that work without setup.
|
|
53
|
+
|
|
54
|
+
### š **Universal Compatibility**
|
|
55
|
+
Works with any programming language and any AI tool that reads AGENTS.md.
|
|
56
|
+
|
|
57
|
+
### ā
**Test-First by Default**
|
|
58
|
+
Generates test skeletons before writing implementation code.
|
|
59
|
+
|
|
60
|
+
### š **Smart Scaling**
|
|
61
|
+
- Simple task ā Direct execution
|
|
62
|
+
- Complex feature ā Full workflow with approvals
|
|
63
|
+
|
|
64
|
+
## How It Actually Works
|
|
65
|
+
|
|
66
|
+
1. **AGENTS.md tells your AI the process** - Like a README but for AI agents
|
|
67
|
+
2. **Progressive rule loading** - Only loads what's needed, when needed
|
|
68
|
+
3. **Quality gates** - Automatic checkpoints ensure consistent output
|
|
69
|
+
4. **You stay in control** - Approval points for major decisions
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
.agents/
|
|
73
|
+
āāā tasks/ # What to build
|
|
74
|
+
ā āāā task-analysis.md # Entry point - AI starts here
|
|
75
|
+
ā āāā ... # Design, test, implement, QA tasks
|
|
76
|
+
āāā workflows/ # How to build it
|
|
77
|
+
āāā rules/ # Quality standards
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Real Examples
|
|
81
|
+
|
|
82
|
+
### Simple Task
|
|
83
|
+
```bash
|
|
84
|
+
You: "Add API endpoint for user search"
|
|
85
|
+
# AI: Reads existing code ā Plans changes ā Tests ā Implements ā Done
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Complex Feature
|
|
89
|
+
```bash
|
|
90
|
+
You: "Build user authentication system"
|
|
91
|
+
# AI: Requirements ā Design doc ā Your approval ā Test skeletons ā
|
|
92
|
+
# Implementation ā Quality checks ā Done
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Installation Options
|
|
96
|
+
|
|
97
|
+
### For New Projects
|
|
98
|
+
```bash
|
|
99
|
+
# Create project
|
|
100
|
+
npx agentic-code my-project
|
|
101
|
+
|
|
102
|
+
# Optional: Add language-specific rules
|
|
103
|
+
npx agentic-code my-project --lang=typescript
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### For Existing Projects
|
|
107
|
+
```bash
|
|
108
|
+
# Copy the framework files
|
|
109
|
+
cp -r path/to/agentic-code/AGENTS.md .
|
|
110
|
+
cp -r path/to/agentic-code/.agents .
|
|
111
|
+
|
|
112
|
+
# Set up language rules (choose one)
|
|
113
|
+
cd .agents/rules/language
|
|
114
|
+
ln -s general/rules.md rules.md
|
|
115
|
+
ln -s general/testing.md testing.md
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Common Questions
|
|
119
|
+
|
|
120
|
+
**Q: Can I use this with other AI coding tools besides Codex?**
|
|
121
|
+
Yes! This framework works with any AGENTS.md-compatible tool like Cursor, Aider, and other LLM-assisted development environments.
|
|
122
|
+
|
|
123
|
+
**Q: What programming languages are supported?**
|
|
124
|
+
The framework is language-agnostic and works with any programming language through general development principles. For TypeScript projects, you can optionally use `--lang=typescript` to enable enhanced TypeScript-specific rules.
|
|
125
|
+
|
|
126
|
+
**Q: Do I need to learn a new syntax?**
|
|
127
|
+
No. Describe what you want in plain language; the framework handles the rest.
|
|
128
|
+
|
|
129
|
+
**Q: What if my AI doesn't support AGENTS.md?**
|
|
130
|
+
Check if your tool is [AGENTS.md compatible](https://agents.md). If so, point it to the AGENTS.md file first.
|
|
131
|
+
|
|
132
|
+
**Q: Can I customize the workflows?**
|
|
133
|
+
Yes, everything in `.agents/` is customizable. The defaults are production-ready, but you can adapt them to your team's process.
|
|
134
|
+
|
|
135
|
+
**Q: What about my existing codebase?**
|
|
136
|
+
It works with existing projects. Your AI analyzes the code and follows your established patterns.
|
|
137
|
+
|
|
138
|
+
## The Technical Stuff
|
|
139
|
+
|
|
140
|
+
The framework has three pillars:
|
|
141
|
+
|
|
142
|
+
1. **Tasks** - Define WHAT to build
|
|
143
|
+
2. **Workflows** - Define HOW to build it
|
|
144
|
+
3. **Rules** - Define quality STANDARDS
|
|
145
|
+
|
|
146
|
+
<details>
|
|
147
|
+
<summary>Advanced features for the curious...</summary>
|
|
148
|
+
|
|
149
|
+
### Progressive Rule Loading
|
|
150
|
+
Rules load based on task analysis:
|
|
151
|
+
- Small (1-2 files) ā Direct execution with minimal rules
|
|
152
|
+
- Medium/Large (3+ files) ā Structured workflow with design docs
|
|
153
|
+
- Each task definition specifies its required rules
|
|
154
|
+
|
|
155
|
+
### Quality Gates
|
|
156
|
+
Automatic checkpoints ensure:
|
|
157
|
+
- Tests pass before proceeding
|
|
158
|
+
- Code meets standards
|
|
159
|
+
- Documentation stays updated
|
|
160
|
+
|
|
161
|
+
### Special Features
|
|
162
|
+
- **Metacognition** - AI self-assessment and error recovery
|
|
163
|
+
- **Plan Injection** - Enforces all required steps are in work plan
|
|
164
|
+
- **Test Generation** - Test skeletons from acceptance criteria
|
|
165
|
+
- **1-Commit Principle** - Each task = one atomic commit
|
|
166
|
+
|
|
167
|
+
</details>
|
|
168
|
+
|
|
169
|
+
## Reviewing Generated Outputs
|
|
170
|
+
|
|
171
|
+
**Important: Always review AI-generated outputs in a separate session.**
|
|
172
|
+
|
|
173
|
+
LLMs cannot reliably review their own outputs within the same context. When the AI generates code or documents, it carries the same assumptions and blind spots into any "self-review." This leads to missed issues that a fresh perspective would catch.
|
|
174
|
+
|
|
175
|
+
### Why Separate Sessions Matter
|
|
176
|
+
|
|
177
|
+
| Same Session | New Session |
|
|
178
|
+
|--------------|-------------|
|
|
179
|
+
| Shares context and assumptions | Fresh perspective, no prior bias |
|
|
180
|
+
| May overlook own mistakes | Catches issues objectively |
|
|
181
|
+
| "Confirmation bias" in review | Applies standards independently |
|
|
182
|
+
|
|
183
|
+
### How to Use Review Tasks
|
|
184
|
+
|
|
185
|
+
After completing implementation or documentation, start a **new session** and request a review:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
# For code review
|
|
189
|
+
You: "Review the implementation in src/auth/ against docs/design/auth-design.md"
|
|
190
|
+
# AI loads code-review task ā Validates against Design Doc ā Reports findings
|
|
191
|
+
|
|
192
|
+
# For document review
|
|
193
|
+
You: "Review docs/design/payment-design.md as a Design Doc"
|
|
194
|
+
# AI loads technical-document-review task ā Checks structure and content ā Reports gaps
|
|
195
|
+
|
|
196
|
+
# For test review
|
|
197
|
+
You: "Review the integration tests in tests/integration/auth.test.ts"
|
|
198
|
+
# AI loads integration-test-review task ā Validates test quality ā Reports issues
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Available Review Tasks
|
|
202
|
+
|
|
203
|
+
| Task | Target | What It Checks |
|
|
204
|
+
|------|--------|----------------|
|
|
205
|
+
| `code-review` | Implementation files | Design Doc compliance, code quality, architecture |
|
|
206
|
+
| `technical-document-review` | Design Docs, ADRs, PRDs | Structure, content quality, failure scenarios |
|
|
207
|
+
| `integration-test-review` | Integration/E2E tests | Skeleton compliance, AAA structure, mock boundaries |
|
|
208
|
+
|
|
209
|
+
**Pro tip:** Make reviews part of your workflow. After any significant generation, switch sessions and review before merging.
|
|
210
|
+
|
|
211
|
+
### For Cursor Users: Isolated Context Reviews via MCP
|
|
212
|
+
|
|
213
|
+
Cursor users can run reviews in isolated contexts without switching sessions using [`sub-agents-mcp`](https://github.com/shinpr/sub-agents-mcp). When review runs as a sub-agent, it executes in a completely separate contextāachieving the same "fresh perspective" benefit as switching sessions, but without leaving your workflow.
|
|
214
|
+
|
|
215
|
+
**Quick Setup:**
|
|
216
|
+
|
|
217
|
+
Add to your MCP config (`~/.cursor/mcp.json` or `.cursor/mcp.json`):
|
|
218
|
+
|
|
219
|
+
```json
|
|
220
|
+
{
|
|
221
|
+
"mcpServers": {
|
|
222
|
+
"sub-agents": {
|
|
223
|
+
"command": "npx",
|
|
224
|
+
"args": ["-y", "sub-agents-mcp"],
|
|
225
|
+
"env": {
|
|
226
|
+
"AGENTS_DIR": "/absolute/path/to/your/project/.agents/tasks",
|
|
227
|
+
"AGENT_TYPE": "cursor"
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
After restarting Cursor, task definitions become available as sub-agents:
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
You: "Use the code-review agent to review src/auth/ against docs/design/auth-design.md"
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
## Start Building
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
npx agentic-code my-awesome-project
|
|
244
|
+
cd my-awesome-project
|
|
245
|
+
# Tell your AI what to build
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
**Consistent, professional AI-assisted development.**
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## Contributing
|
|
253
|
+
|
|
254
|
+
Found a bug? Want to add language-specific rules? PRs welcome!
|
|
255
|
+
|
|
256
|
+
- š [Report issues](https://github.com/shinpr/agentic-code/issues)
|
|
257
|
+
- š§ [Submit PRs](https://github.com/shinpr/agentic-code/pulls)
|
|
258
|
+
- š [Improve docs](https://github.com/shinpr/agentic-code/pulls)
|
|
259
|
+
|
|
260
|
+
## License
|
|
261
|
+
|
|
262
|
+
MIT - Use it however you want.
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
Built on the [AGENTS.md standard](https://agents.md) ā an open community specification for AI coding agents.
|
|
267
|
+
|
|
268
|
+
**Ready to code properly with AI?** `npx agentic-code my-project`
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const { execSync } = require('child_process');
|
|
6
|
+
|
|
7
|
+
// Parse command line arguments
|
|
8
|
+
const args = process.argv.slice(2);
|
|
9
|
+
const projectName = args[0];
|
|
10
|
+
const langOption = args.find(arg => arg.startsWith('--lang='));
|
|
11
|
+
const selectedLang = langOption ? langOption.split('=')[1] : 'general';
|
|
12
|
+
|
|
13
|
+
// Show help if no project name provided
|
|
14
|
+
if (!projectName) {
|
|
15
|
+
console.log(`
|
|
16
|
+
š¤ Agentic Code - Task-oriented context engineering framework
|
|
17
|
+
|
|
18
|
+
Usage:
|
|
19
|
+
npx github:shinpr/agentic-code <project-name> [--lang=general|typescript]
|
|
20
|
+
|
|
21
|
+
Examples:
|
|
22
|
+
npx github:shinpr/agentic-code my-project # General (language-agnostic)
|
|
23
|
+
npx github:shinpr/agentic-code my-project --lang=general # General (explicit)
|
|
24
|
+
npx github:shinpr/agentic-code my-project --lang=typescript # TypeScript-specific
|
|
25
|
+
|
|
26
|
+
Language options:
|
|
27
|
+
general (default): Universal development principles for any language
|
|
28
|
+
typescript: Enhanced rules and TypeScript-specific tooling
|
|
29
|
+
`);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Validate project name
|
|
34
|
+
if (!/^[a-zA-Z0-9_-]+$/.test(projectName)) {
|
|
35
|
+
console.error('ā Project name can only contain letters, numbers, hyphens, and underscores.');
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Check if directory already exists
|
|
40
|
+
if (fs.existsSync(projectName)) {
|
|
41
|
+
console.error(`ā Directory '${projectName}' already exists.`);
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
console.log(`š Creating Agentic Code project: ${projectName}`);
|
|
46
|
+
console.log(`š Language: ${selectedLang}\n`);
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
// Create project directory
|
|
50
|
+
fs.mkdirSync(projectName, { recursive: true });
|
|
51
|
+
|
|
52
|
+
// Get the template directory (current package location)
|
|
53
|
+
const templateDir = path.dirname(__dirname);
|
|
54
|
+
|
|
55
|
+
// Copy template files
|
|
56
|
+
console.log('š Copying template files...');
|
|
57
|
+
copyDirectory(templateDir, projectName, ['.git', 'node_modules', 'bin']);
|
|
58
|
+
|
|
59
|
+
// Navigate to project directory
|
|
60
|
+
process.chdir(projectName);
|
|
61
|
+
|
|
62
|
+
// Initialize git repository
|
|
63
|
+
console.log('š¦ Initializing Git repository...');
|
|
64
|
+
execSync('git init', { stdio: 'inherit' });
|
|
65
|
+
|
|
66
|
+
// Set up project configuration
|
|
67
|
+
console.log('āļø Setting up project configuration...');
|
|
68
|
+
execSync(`node scripts/setup.js --lang=${selectedLang}`, { stdio: 'inherit' });
|
|
69
|
+
|
|
70
|
+
// Create initial commit
|
|
71
|
+
console.log('š¾ Creating initial commit...');
|
|
72
|
+
execSync('git add .', { stdio: 'inherit' });
|
|
73
|
+
execSync('git commit -m "feat: Initialize Agentic Code project"', { stdio: 'inherit' });
|
|
74
|
+
|
|
75
|
+
console.log(`\nš Project '${projectName}' created successfully!`);
|
|
76
|
+
console.log('\nš Next steps:');
|
|
77
|
+
console.log(` cd ${projectName}`);
|
|
78
|
+
console.log(' 1. Read AGENTS.md to understand the framework');
|
|
79
|
+
console.log(' 2. Start with: open .agents/tasks/task-analysis.md');
|
|
80
|
+
console.log(' 3. Follow the task-rule-matrix for complex workflows');
|
|
81
|
+
console.log('\nš” Need help? Check the documentation or open an issue on GitHub.');
|
|
82
|
+
|
|
83
|
+
} catch (error) {
|
|
84
|
+
console.error('ā Error creating project:', error.message);
|
|
85
|
+
|
|
86
|
+
// Cleanup on error
|
|
87
|
+
if (fs.existsSync(projectName)) {
|
|
88
|
+
try {
|
|
89
|
+
fs.rmSync(projectName, { recursive: true, force: true });
|
|
90
|
+
} catch (cleanupError) {
|
|
91
|
+
console.error('ā Error during cleanup:', cleanupError.message);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
process.exit(1);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Helper function to copy directory recursively
|
|
99
|
+
function copyDirectory(src, dest, excludeDirs = []) {
|
|
100
|
+
const entries = fs.readdirSync(src, { withFileTypes: true });
|
|
101
|
+
|
|
102
|
+
for (const entry of entries) {
|
|
103
|
+
if (excludeDirs.includes(entry.name)) {
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const srcPath = path.join(src, entry.name);
|
|
108
|
+
const destPath = path.join(dest, entry.name);
|
|
109
|
+
|
|
110
|
+
if (entry.isDirectory()) {
|
|
111
|
+
fs.mkdirSync(destPath, { recursive: true });
|
|
112
|
+
copyDirectory(srcPath, destPath, excludeDirs);
|
|
113
|
+
} else {
|
|
114
|
+
fs.copyFileSync(srcPath, destPath);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agentic-code",
|
|
3
|
+
"version": "0.5.1",
|
|
4
|
+
"description": "Task-oriented context engineering framework for LLM coding agents - AGENTS.md standard compliant",
|
|
5
|
+
"files": [
|
|
6
|
+
"bin/",
|
|
7
|
+
".agents/",
|
|
8
|
+
"AGENTS.md",
|
|
9
|
+
"scripts/"
|
|
10
|
+
],
|
|
11
|
+
"bin": {
|
|
12
|
+
"agentic-code": "./bin/cli.js"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"setup": "node scripts/setup.js",
|
|
16
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"llm",
|
|
20
|
+
"ai",
|
|
21
|
+
"coding-agent",
|
|
22
|
+
"agents-md",
|
|
23
|
+
"context-engineering",
|
|
24
|
+
"agentic-coding",
|
|
25
|
+
"claude-code",
|
|
26
|
+
"cursor",
|
|
27
|
+
"github-copilot",
|
|
28
|
+
"template",
|
|
29
|
+
"boilerplate"
|
|
30
|
+
],
|
|
31
|
+
"author": "Shinsuke Kagawa",
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"packageManager": "pnpm@10.15.1",
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "git+https://github.com/shinpr/agentic-code.git"
|
|
37
|
+
},
|
|
38
|
+
"bugs": {
|
|
39
|
+
"url": "https://github.com/shinpr/agentic-code/issues"
|
|
40
|
+
},
|
|
41
|
+
"homepage": "https://github.com/shinpr/agentic-code#readme",
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">=20.0.0"
|
|
44
|
+
}
|
|
45
|
+
}
|
package/scripts/setup.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const { execSync } = require('child_process');
|
|
6
|
+
|
|
7
|
+
// Parse command line arguments for language option
|
|
8
|
+
const args = process.argv.slice(2);
|
|
9
|
+
const langOption = args.find(arg => arg.startsWith('--lang='));
|
|
10
|
+
const selectedLang = langOption ? langOption.split('=')[1] : 'general';
|
|
11
|
+
|
|
12
|
+
console.log('š Setting up Agentic Code framework...\n');
|
|
13
|
+
|
|
14
|
+
// Check if we're in a Git repository
|
|
15
|
+
function isGitRepo() {
|
|
16
|
+
try {
|
|
17
|
+
execSync('git rev-parse --is-inside-work-tree', { stdio: 'ignore' });
|
|
18
|
+
return true;
|
|
19
|
+
} catch {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Initialize Git repository if not exists
|
|
25
|
+
if (!isGitRepo()) {
|
|
26
|
+
console.log('š Initializing Git repository...');
|
|
27
|
+
try {
|
|
28
|
+
execSync('git init', { stdio: 'inherit' });
|
|
29
|
+
console.log('ā Git repository initialized\n');
|
|
30
|
+
} catch (error) {
|
|
31
|
+
console.error('ā Failed to initialize Git repository:', error.message);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Set up language configuration
|
|
36
|
+
const languageNames = {
|
|
37
|
+
general: 'General (language-agnostic)',
|
|
38
|
+
typescript: 'TypeScript'
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const languageName = languageNames[selectedLang] || selectedLang;
|
|
42
|
+
console.log(`āļø Setting up ${languageName} configuration...`);
|
|
43
|
+
|
|
44
|
+
try {
|
|
45
|
+
const langPath = path.join(__dirname, '..', '.agents', 'rules', 'language');
|
|
46
|
+
const sourcePath = path.join(langPath, selectedLang);
|
|
47
|
+
const targetRulesPath = path.join(langPath, 'rules.md');
|
|
48
|
+
const targetTestingPath = path.join(langPath, 'testing.md');
|
|
49
|
+
|
|
50
|
+
// Check if source directory exists
|
|
51
|
+
if (!fs.existsSync(sourcePath)) {
|
|
52
|
+
console.error(`ā Language '${selectedLang}' is not supported.`);
|
|
53
|
+
console.log('Available languages: general, typescript');
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Remove existing symlinks if they exist
|
|
58
|
+
if (fs.existsSync(targetRulesPath)) {
|
|
59
|
+
fs.unlinkSync(targetRulesPath);
|
|
60
|
+
}
|
|
61
|
+
if (fs.existsSync(targetTestingPath)) {
|
|
62
|
+
fs.unlinkSync(targetTestingPath);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Create new symlinks
|
|
66
|
+
fs.symlinkSync(path.join(sourcePath, 'rules.md'), targetRulesPath);
|
|
67
|
+
fs.symlinkSync(path.join(sourcePath, 'testing.md'), targetTestingPath);
|
|
68
|
+
|
|
69
|
+
console.log(`ā ${languageName} has been set as the active language.`);
|
|
70
|
+
console.log(` - .agents/rules/language/rules.md ā ${selectedLang}/rules.md`);
|
|
71
|
+
console.log(` - .agents/rules/language/testing.md ā ${selectedLang}/testing.md\n`);
|
|
72
|
+
} catch (error) {
|
|
73
|
+
console.error('ā Failed to setup language configuration:', error.message);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Success message
|
|
77
|
+
console.log('š Agentic Code framework is ready to use!');
|
|
78
|
+
console.log('\nš Quick Start:');
|
|
79
|
+
console.log(' 1. Read AGENTS.md to understand the framework');
|
|
80
|
+
console.log(' 2. Start with task analysis: .agents/tasks/task-analysis.md');
|
|
81
|
+
console.log(' 3. Follow the task-rule-matrix for complex workflows');
|
|
82
|
+
console.log('\nš” Need help? Check the documentation or open an issue on GitHub.');
|